diff options
Diffstat (limited to 'activerecord/test/cases/fixtures_test.rb')
-rwxr-xr-x | activerecord/test/cases/fixtures_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index 8dbccbba98..dce04e63be 100755 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -590,3 +590,17 @@ class ActiveSupportSubclassWithFixturesTest < ActiveRecord::TestCase assert_equal parrots(:louis), Parrot.find_by_name("King Louis") end end + +class FixtureLoadingTest < ActiveRecord::TestCase + def test_logs_message_for_failed_dependency_load + Test::Unit::TestCase.expects(:require_dependency).with(:does_not_exist).raises(LoadError) + ActiveRecord::Base.logger.expects(:warn) + Test::Unit::TestCase.try_to_load_dependency(:does_not_exist) + end + + def test_does_not_logs_message_for_successful_dependency_load + Test::Unit::TestCase.expects(:require_dependency).with(:works_out_fine) + ActiveRecord::Base.logger.expects(:warn).never + Test::Unit::TestCase.try_to_load_dependency(:works_out_fine) + end +end |