1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix tests broken by mocha absence [#186 state:resolved]

Two ActiveRecord tests depended on mocha but were not marked as such.
Place them in a use_mocha block so the test suite passes.

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
Tim Pope 2008-05-13 15:22:48 -04:00 committed by Pratik Naik
parent d8bcec6ce6
commit 3a0d8adcf2

View file

@ -610,15 +610,17 @@ class ActiveSupportSubclassWithFixturesTest < ActiveRecord::TestCase
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
uses_mocha 'reloading_fixtures_through_accessor_methods' do
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)
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
end