diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-03-17 21:48:28 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-03-17 21:48:28 +0000 |
commit | fbf41c72a930a1b879452d137ba3d75d5ceaf358 (patch) | |
tree | 5a7fb0aaaac82854ff68feb7412e48c080397165 /activerecord/test | |
parent | d07d6e900c1919bfafd4e2382b31cfe0faeebaa0 (diff) | |
download | rails-fbf41c72a930a1b879452d137ba3d75d5ceaf358.tar.gz rails-fbf41c72a930a1b879452d137ba3d75d5ceaf358.tar.bz2 rails-fbf41c72a930a1b879452d137ba3d75d5ceaf358.zip |
Added logging for dependency load errors with fixtures (closes #11056) [stuthulhu]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9050 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-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 |