diff options
Diffstat (limited to 'activerecord/test/cases/helper.rb')
-rw-r--r-- | activerecord/test/cases/helper.rb | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb index 0c03d29dec..c18ecf6f8f 100644 --- a/activerecord/test/cases/helper.rb +++ b/activerecord/test/cases/helper.rb @@ -5,8 +5,8 @@ require 'config' require 'test/unit' require 'active_record' -require 'active_record/fixtures' require 'active_record/test_case' +require 'active_record/fixtures' require 'connection' # Show backtraces for deprecated behavior for quicker cleanup. @@ -48,15 +48,22 @@ class << ActiveRecord::Base end unless ENV['FIXTURE_DEBUG'] - module Test #:nodoc: - module Unit #:nodoc: - class << TestCase #:nodoc: - def try_to_load_dependency_with_silence(*args) - ActiveRecord::Base.logger.silence { try_to_load_dependency_without_silence(*args)} - end - - alias_method_chain :try_to_load_dependency, :silence - end + module ActiveRecord::TestFixtures::ClassMethods + def try_to_load_dependency_with_silence(*args) + ActiveRecord::Base.logger.silence { try_to_load_dependency_without_silence(*args)} end + + alias_method_chain :try_to_load_dependency, :silence + end +end + +class ActiveSupport::TestCase + include ActiveRecord::TestFixtures + self.fixture_path = FIXTURES_ROOT + self.use_instantiated_fixtures = false + self.use_transactional_fixtures = true + + def create_fixtures(*table_names, &block) + Fixtures.create_fixtures(ActiveSupport::TestCase.fixture_path, table_names, {}, &block) end -end
\ No newline at end of file +end |