ref: refs/heads/network
commit ab4f2f358e0e83f6662b6727bda24f1c7b9e4875
Author: Klaus Kämpf
Date: Wed Sep 9 16:28:04 2009 +0200
Don't re-initialize global constants in test mode
Running "rake test" loads all test in one go, thus keeping global
constants across test files.
---
.../test/functional/resources_controller_test.rb | 8 ++++++--
webservice/test/functional/resources_route_test.rb | 9 ++++++++-
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/webservice/test/functional/resources_controller_test.rb b/webservice/test/functional/resources_controller_test.rb
index 0c41226..9def828 100644
--- a/webservice/test/functional/resources_controller_test.rb
+++ b/webservice/test/functional/resources_controller_test.rb
@@ -11,9 +11,13 @@ class TestPlugin
end
end
-USER_ROLES_CONFIG = File.join(File.dirname(__FILE__), "..", "fixtures", "yast_user_roles")
+unless defined? USER_ROLES_CONFIG
+ USER_ROLES_CONFIG = File.join(File.dirname(__FILE__), "..", "fixtures", "yast_user_roles")
+end
-RESOURCE_REGISTRATION_TESTING = true # prevent plugin registration in environment.rb
+unless defined? RESOURCE_REGISTRATION_TESTING
+ RESOURCE_REGISTRATION_TESTING = true # prevent plugin registration in environment.rb
+end
require File.join(File.dirname(__FILE__), "..", "test_helper")
require File.join(File.dirname(__FILE__), "..", "..", "lib", "resource_registration")
diff --git a/webservice/test/functional/resources_route_test.rb b/webservice/test/functional/resources_route_test.rb
index 33930d2..a9e4f66 100644
--- a/webservice/test/functional/resources_route_test.rb
+++ b/webservice/test/functional/resources_route_test.rb
@@ -10,7 +10,14 @@ class TestPlugin
end
end
-RESOURCE_REGISTRATION_TESTING = true # prevent plugin registration in environment.rb
+unless defined? USER_ROLES_CONFIG
+ USER_ROLES_CONFIG = File.join(File.dirname(__FILE__), "..", "fixtures", "yast_user_roles")
+end
+
+unless defined? RESOURCE_REGISTRATION_TESTING
+ RESOURCE_REGISTRATION_TESTING = true # prevent plugin registration in environment.rb
+end
+
require File.join(File.dirname(__FILE__), "..", "test_helper")
require File.join(File.dirname(__FILE__), "..", "..", "lib", "resource_registration")
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org