提交 3a0d8adc 编写于 作者: T Tim Pope 提交者: Pratik Naik

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: NPratik Naik <pratiknaik@gmail.com>
上级 d8bcec6c
...@@ -610,15 +610,17 @@ def test_foo ...@@ -610,15 +610,17 @@ def test_foo
end end
class FixtureLoadingTest < ActiveRecord::TestCase class FixtureLoadingTest < ActiveRecord::TestCase
def test_logs_message_for_failed_dependency_load uses_mocha 'reloading_fixtures_through_accessor_methods' do
Test::Unit::TestCase.expects(:require_dependency).with(:does_not_exist).raises(LoadError) def test_logs_message_for_failed_dependency_load
ActiveRecord::Base.logger.expects(:warn) Test::Unit::TestCase.expects(:require_dependency).with(:does_not_exist).raises(LoadError)
Test::Unit::TestCase.try_to_load_dependency(:does_not_exist) ActiveRecord::Base.logger.expects(:warn)
end Test::Unit::TestCase.try_to_load_dependency(:does_not_exist)
end
def test_does_not_logs_message_for_successful_dependency_load def test_does_not_logs_message_for_successful_dependency_load
Test::Unit::TestCase.expects(:require_dependency).with(:works_out_fine) Test::Unit::TestCase.expects(:require_dependency).with(:works_out_fine)
ActiveRecord::Base.logger.expects(:warn).never ActiveRecord::Base.logger.expects(:warn).never
Test::Unit::TestCase.try_to_load_dependency(:works_out_fine) Test::Unit::TestCase.try_to_load_dependency(:works_out_fine)
end
end end
end end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册