Permalink
Browse files

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>
  • Loading branch information...
1 parent d8bcec6 commit 3a0d8adcf25e27f7976a1d0996be05f21ffc3805 @tpope tpope committed with lifo May 13, 2008
Showing with 11 additions and 9 deletions.
  1. +11 −9 activerecord/test/cases/fixtures_test.rb
View
20 activerecord/test/cases/fixtures_test.rb
@@ -610,15 +610,17 @@ def test_foo
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

0 comments on commit 3a0d8ad

Please sign in to comment.