ref: refs/heads/use-activeresource
commit fbcb98bacf9c2603a53d0235b34fc7395691c6de
Author: Ladislav Slezak
Date: Fri Aug 21 09:31:36 2009 +0200
Fixed testsuite init - set 'test' mode properly
---
plugins/language/test/test_helper.rb | 7 +++----
plugins/permissions/test/test_helper.rb | 7 +++----
plugins/services/test/test_helper.rb | 5 ++---
plugins/system/test/test_helper.rb | 7 +++----
plugins/systemtime/test/test_helper.rb | 7 +++----
webclient/config/environment.rb | 5 +----
6 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/plugins/language/test/test_helper.rb b/plugins/language/test/test_helper.rb
index ca844a2..d8863e1 100644
--- a/plugins/language/test/test_helper.rb
+++ b/plugins/language/test/test_helper.rb
@@ -1,9 +1,8 @@
# find the rails parent
require File.join(File.dirname(__FILE__), '..', 'config', 'rails_parent')
-# first config rails
-require File.expand_path( File.join("config","environment"), RailsParent.parent )
-# then enable testing, this will get the routing right
+
ENV["RAILS_ENV"] = "test"
+require File.expand_path( File.join("config","environment"), RailsParent.parent )
require 'test_help'
require 'rubygems'
@@ -53,4 +52,4 @@ class ActiveSupport::TestCase
raise
end
-end
\ No newline at end of file
+end
diff --git a/plugins/permissions/test/test_helper.rb b/plugins/permissions/test/test_helper.rb
index ca844a2..d8863e1 100644
--- a/plugins/permissions/test/test_helper.rb
+++ b/plugins/permissions/test/test_helper.rb
@@ -1,9 +1,8 @@
# find the rails parent
require File.join(File.dirname(__FILE__), '..', 'config', 'rails_parent')
-# first config rails
-require File.expand_path( File.join("config","environment"), RailsParent.parent )
-# then enable testing, this will get the routing right
+
ENV["RAILS_ENV"] = "test"
+require File.expand_path( File.join("config","environment"), RailsParent.parent )
require 'test_help'
require 'rubygems'
@@ -53,4 +52,4 @@ class ActiveSupport::TestCase
raise
end
-end
\ No newline at end of file
+end
diff --git a/plugins/services/test/test_helper.rb b/plugins/services/test/test_helper.rb
index 5d083a8..a9445b7 100644
--- a/plugins/services/test/test_helper.rb
+++ b/plugins/services/test/test_helper.rb
@@ -9,10 +9,9 @@ unless rails_parent
exit
end
end
-# first config rails
-require File.expand_path(rails_parent + "/config/environment")
-# then enable testing, this will get the routing right
+
ENV["RAILS_ENV"] = "test"
+require File.expand_path(rails_parent + "/config/environment")
require 'rubygems'
require 'active_support'
diff --git a/plugins/system/test/test_helper.rb b/plugins/system/test/test_helper.rb
index ca844a2..d8863e1 100644
--- a/plugins/system/test/test_helper.rb
+++ b/plugins/system/test/test_helper.rb
@@ -1,9 +1,8 @@
# find the rails parent
require File.join(File.dirname(__FILE__), '..', 'config', 'rails_parent')
-# first config rails
-require File.expand_path( File.join("config","environment"), RailsParent.parent )
-# then enable testing, this will get the routing right
+
ENV["RAILS_ENV"] = "test"
+require File.expand_path( File.join("config","environment"), RailsParent.parent )
require 'test_help'
require 'rubygems'
@@ -53,4 +52,4 @@ class ActiveSupport::TestCase
raise
end
-end
\ No newline at end of file
+end
diff --git a/plugins/systemtime/test/test_helper.rb b/plugins/systemtime/test/test_helper.rb
index ca844a2..d8863e1 100644
--- a/plugins/systemtime/test/test_helper.rb
+++ b/plugins/systemtime/test/test_helper.rb
@@ -1,9 +1,8 @@
# find the rails parent
require File.join(File.dirname(__FILE__), '..', 'config', 'rails_parent')
-# first config rails
-require File.expand_path( File.join("config","environment"), RailsParent.parent )
-# then enable testing, this will get the routing right
+
ENV["RAILS_ENV"] = "test"
+require File.expand_path( File.join("config","environment"), RailsParent.parent )
require 'test_help'
require 'rubygems'
@@ -53,4 +52,4 @@ class ActiveSupport::TestCase
raise
end
-end
\ No newline at end of file
+end
diff --git a/webclient/config/environment.rb b/webclient/config/environment.rb
index b9c296e..100882e 100644
--- a/webclient/config/environment.rb
+++ b/webclient/config/environment.rb
@@ -21,10 +21,7 @@ init = Rails::Initializer.run do |config|
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
# configure load path for test unit, needed for mocha >= 0.9.6 and test-unit >= 2.0.0
- config.gem 'test-unit', :lib => 'test/unit' if ENV['RAILS_ENV'] == 'test' or
- # FIXME: 'rake test' in plugins sets test mode too late, script/server sets both variables
- # to 'development' so this should not be set in real development mode
- (RAILS_ENV == 'development' and ENV['RAILS_ENV'].nil?)
+ config.gem 'test-unit', :lib => 'test/unit' if ENV['RAILS_ENV'] == 'test'
# Specify gems that this application depends on.
# They can then be installed with "rake gems:install" on new installations.
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org