Skip to content
This repository
Browse code

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...
commit 3a0d8adcf25e27f7976a1d0996be05f21ffc3805 1 parent d8bcec6
Tim Pope tpope authored lifo committed

Showing 1 changed file with 11 additions and 9 deletions. Show diff stats Hide diff stats

  1. +11 9 activerecord/test/cases/fixtures_test.rb
20 activerecord/test/cases/fixtures_test.rb
@@ -610,15 +610,17 @@ def test_foo
610 610 end
611 611
612 612 class FixtureLoadingTest < ActiveRecord::TestCase
613   - def test_logs_message_for_failed_dependency_load
614   - Test::Unit::TestCase.expects(:require_dependency).with(:does_not_exist).raises(LoadError)
615   - ActiveRecord::Base.logger.expects(:warn)
616   - Test::Unit::TestCase.try_to_load_dependency(:does_not_exist)
617   - end
  613 + uses_mocha 'reloading_fixtures_through_accessor_methods' do
  614 + def test_logs_message_for_failed_dependency_load
  615 + Test::Unit::TestCase.expects(:require_dependency).with(:does_not_exist).raises(LoadError)
  616 + ActiveRecord::Base.logger.expects(:warn)
  617 + Test::Unit::TestCase.try_to_load_dependency(:does_not_exist)
  618 + end
618 619
619   - def test_does_not_logs_message_for_successful_dependency_load
620   - Test::Unit::TestCase.expects(:require_dependency).with(:works_out_fine)
621   - ActiveRecord::Base.logger.expects(:warn).never
622   - Test::Unit::TestCase.try_to_load_dependency(:works_out_fine)
  620 + def test_does_not_logs_message_for_successful_dependency_load
  621 + Test::Unit::TestCase.expects(:require_dependency).with(:works_out_fine)
  622 + ActiveRecord::Base.logger.expects(:warn).never
  623 + Test::Unit::TestCase.try_to_load_dependency(:works_out_fine)
  624 + end
623 625 end
624 626 end

0 comments on commit 3a0d8ad

Please sign in to comment.
Something went wrong with that request. Please try again.