test/unit/mock_test.rb in bourne-1.1.2 vs test/unit/mock_test.rb in bourne-1.2.0

- old
+ new

@@ -1,5 +1,9 @@ +# to update: +# - copy new code from https://raw.github.com/freerange/mocha/master/test/unit/mock_test.rb +# - keep: require 'bourne/mock' +# - keep: FakeExpectation test require File.expand_path('../../test_helper', __FILE__) require 'bourne/mock' require 'mocha/expectation_error' require 'set' require 'simple_counter' @@ -7,21 +11,21 @@ class MockTest < Test::Unit::TestCase include Mocha def test_should_set_single_expectation - mock = build_mock - mock.expects(:method1).returns(1) - assert_nothing_raised(ExpectationError) do - assert_equal 1, mock.method1 - end + mock = build_mock + mock.expects(:method1).returns(1) + assert_nothing_raised(ExpectationError) do + assert_equal 1, mock.method1 + end end def test_should_build_and_store_expectations - mock = build_mock - expectation = mock.expects(:method1) - assert_not_nil expectation - assert_equal [expectation], mock.__expectations__.to_a + mock = build_mock + expectation = mock.expects(:method1) + assert_not_nil expectation + assert_equal [expectation], mock.__expectations__.to_a end def test_should_not_stub_everything_by_default mock = build_mock assert_equal false, mock.everything_stubbed