diff --git a/lib/mocha/invocation.rb b/lib/mocha/invocation.rb index b2030c660..e2a3546df 100644 --- a/lib/mocha/invocation.rb +++ b/lib/mocha/invocation.rb @@ -55,7 +55,7 @@ def arguments end def call_description - description = "#{@mock.mocha_inspect}.#{@method_name}#{ParametersMatcher.new(@arguments).mocha_inspect}" + description = "#{@mock.mocha_inspect}.#{@method_name}#{argument_description}" description << ' { ... }' unless @block.nil? description end @@ -73,5 +73,14 @@ def result_description def full_description "\n - #{call_description} #{result_description}" end + + private + + def argument_description + signature = arguments.mocha_inspect + signature = signature.gsub(/^\[|\]$/, '') + signature = signature.gsub(/^\{|\}$/, '') if arguments.length == 1 + "(#{signature})" + end end end