diff --git a/test/acceptance/failure_messages_test.rb b/test/acceptance/failure_messages_test.rb index 281c4cb7..38640d17 100644 --- a/test/acceptance/failure_messages_test.rb +++ b/test/acceptance/failure_messages_test.rb @@ -52,11 +52,13 @@ def test_should_display_mock_address_when_expectation_was_on_unnamed_mock assert_match Regexp.new("#"), test_result.failures[0].message end - def test_should_display_string_when_expectation_was_on_string - test_result = run_as_test do - 'Foo'.expects(:bar) + unless Mocha::RUBY_V34_PLUS + def test_should_display_string_when_expectation_was_on_string + test_result = run_as_test do + 'Foo'.expects(:bar) + end + assert_match Regexp.new(%("Foo")), test_result.failures[0].message end - assert_match Regexp.new(%("Foo")), test_result.failures[0].message end def test_should_display_that_block_was_expected diff --git a/test/acceptance/partial_mocks_test.rb b/test/acceptance/partial_mocks_test.rb index 5ccaccb3..2c4c61ad 100644 --- a/test/acceptance/partial_mocks_test.rb +++ b/test/acceptance/partial_mocks_test.rb @@ -13,8 +13,8 @@ def teardown def test_should_pass_if_all_expectations_are_satisfied test_result = run_as_test do - partial_mock_one = 'partial_mock_one' - partial_mock_two = 'partial_mock_two' + partial_mock_one = Object.new + partial_mock_two = Object.new partial_mock_one.expects(:first) partial_mock_one.expects(:second) @@ -29,8 +29,8 @@ def test_should_pass_if_all_expectations_are_satisfied def test_should_fail_if_all_expectations_are_not_satisfied test_result = run_as_test do - partial_mock_one = 'partial_mock_one' - partial_mock_two = 'partial_mock_two' + partial_mock_one = Object.new + partial_mock_two = Object.new partial_mock_one.expects(:first) partial_mock_one.expects(:second) diff --git a/test/acceptance/sequence_block_test.rb b/test/acceptance/sequence_block_test.rb index 86513cc9..03bad0fa 100644 --- a/test/acceptance/sequence_block_test.rb +++ b/test/acceptance/sequence_block_test.rb @@ -76,8 +76,8 @@ def test_should_allow_invocations_in_sequence_even_if_expected_on_different_mock def test_should_constrain_invocations_to_occur_in_expected_order_even_if_expected_on_partial_mocks test_result = run_as_test do - partial_mock_one = '1' - partial_mock_two = '2' + partial_mock_one = Object.new + partial_mock_two = Object.new sequence('one') do partial_mock_one.expects(:first) @@ -93,8 +93,8 @@ def test_should_constrain_invocations_to_occur_in_expected_order_even_if_expecte def test_should_allow_invocations_in_sequence_even_if_expected_on_partial_mocks test_result = run_as_test do - partial_mock_one = '1' - partial_mock_two = '2' + partial_mock_one = Object.new + partial_mock_two = Object.new sequence('one') do partial_mock_one.expects(:first) diff --git a/test/acceptance/sequence_test.rb b/test/acceptance/sequence_test.rb index 52bcd614..7d915a61 100644 --- a/test/acceptance/sequence_test.rb +++ b/test/acceptance/sequence_test.rb @@ -72,8 +72,8 @@ def test_should_allow_invocations_in_sequence_even_if_expected_on_different_mock def test_should_constrain_invocations_to_occur_in_expected_order_even_if_expected_on_partial_mocks test_result = run_as_test do - partial_mock_one = '1' - partial_mock_two = '2' + partial_mock_one = Object.new + partial_mock_two = Object.new sequence = sequence('one') partial_mock_one.expects(:first).in_sequence(sequence) @@ -88,8 +88,8 @@ def test_should_constrain_invocations_to_occur_in_expected_order_even_if_expecte def test_should_allow_invocations_in_sequence_even_if_expected_on_partial_mocks test_result = run_as_test do - partial_mock_one = '1' - partial_mock_two = '2' + partial_mock_one = Object.new + partial_mock_two = Object.new sequence = sequence('one') partial_mock_one.expects(:first).in_sequence(sequence)