提交 d72201e4 编写于 作者: D David Heinemeier Hansson

Backed out of setting testing settings through initializer as that would break...

Backed out of setting testing settings through initializer as that would break backwards compatibility

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2618 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 ccd18dc6
......@@ -3,5 +3,11 @@
require 'test_help'
class Test::Unit::TestCase
# Turn off transactional fixtures if you're working with MyISAM tables in MySQL
self.use_transactional_fixtures = true
# Instantiated fixtures are slow, but give you @david where you otherwise would need people(:david)
self.use_instantiated_fixtures = false
# Add more helper methods to be used by all tests here...
end
\ No newline at end of file
......@@ -36,7 +36,6 @@ def process
load_environment
initialize_database
initialize_fixture_settings
initialize_logger
initialize_framework_logging
initialize_framework_views
......@@ -101,17 +100,6 @@ def initialize_database
ActiveRecord::Base.establish_connection
end
def initialize_fixture_settings
return if configuration.environment != 'test' || !configuration.frameworks.include?(:active_record)
require 'test/unit'
require 'active_record/fixtures'
Test::Unit::TestCase.use_transactional_fixtures = configuration.transactional_fixtures
Test::Unit::TestCase.use_instantiated_fixtures = configuration.instantiated_fixtures
Test::Unit::TestCase.pre_loaded_fixtures = configuration.pre_loaded_fixtures
end
def initialize_logger
# if the environment has explicitly defined a logger, use it
return if defined?(RAILS_DEFAULT_LOGGER)
......@@ -199,9 +187,6 @@ def initialize
self.breakpoint_server = default_breakpoint_server
self.whiny_nils = default_whiny_nils
self.database_configuration_file = default_database_configuration_file
self.transactional_fixtures = default_transactional_fixtures
self.instantiated_fixtures = default_instantiated_fixtures
self.pre_loaded_fixtures = default_pre_loaded_fixtures
for framework in default_frameworks
self.send("#{framework}=", OrderedOptions.new)
......@@ -294,18 +279,6 @@ def default_breakpoint_server
def default_whiny_nils
false
end
def default_transactional_fixtures
true
end
def default_instantiated_fixtures
false
end
def default_pre_loaded_fixtures
false
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册