diff --git a/lib/mocha/parameters_matcher.rb b/lib/mocha/parameters_matcher.rb index 72645fe6..da1abb54 100644 --- a/lib/mocha/parameters_matcher.rb +++ b/lib/mocha/parameters_matcher.rb @@ -22,9 +22,13 @@ def parameters_match?(actual_parameters) end def mocha_inspect - signature = matchers.mocha_inspect - signature = signature.gsub(/^\[|\]$/, '') - "(#{signature})" + if @matching_block + '(arguments_accepted_by_custom_matching_block)' + else + signature = matchers.mocha_inspect + signature = signature.gsub(/^\[|\]$/, '') + "(#{signature})" + end end def matchers diff --git a/test/unit/parameters_matcher_test.rb b/test/unit/parameters_matcher_test.rb index 53ffafa7..a97d2d4a 100644 --- a/test/unit/parameters_matcher_test.rb +++ b/test/unit/parameters_matcher_test.rb @@ -103,4 +103,9 @@ def test_should_indicate_that_matcher_will_match_any_actual_parameters parameters_matcher = ParametersMatcher.new assert_equal '(any_parameters)', parameters_matcher.mocha_inspect end + + def test_should_indicate_that_matcher_logic_is_defined_by_custom_block + parameters_matcher = ParametersMatcher.new { true } + assert_equal '(arguments_accepted_by_custom_matching_block)', parameters_matcher.mocha_inspect + end end