Sha256: d804e20b0897023378ad98b340511977b9bf7d3858bd52e78267104520eabdf5

Contents?: true

Size: 697 Bytes

Versions: 5

Compression:

Stored size: 697 Bytes

Contents

module Mocha
  # Exception raised when an unexpected method is invoked
  class UnexpectedInvocation
    # @private
    def initialize(mock, symbol, *arguments)
      @mock = mock
      @symbol = symbol
      @arguments = arguments
    end

    # @private
    def full_description
      method_matcher = MethodMatcher.new(@symbol)
      parameters_matcher = ParametersMatcher.new(@arguments)
      method_signature = "#{@mock.mocha_inspect}.#{method_matcher.mocha_inspect}#{parameters_matcher.mocha_inspect}"
      "unexpected invocation: #{method_signature}\n"
    end

    # @private
    def short_description
      "unexpected invocation: #{@symbol}(#{@arguments.join(', ')})"
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
mocha-1.9.0 lib/mocha/unexpected_invocation.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/mocha-1.8.0/lib/mocha/unexpected_invocation.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/mocha-1.8.0/lib/mocha/unexpected_invocation.rb
mocha-1.8.0 lib/mocha/unexpected_invocation.rb
mocha-1.7.0 lib/mocha/unexpected_invocation.rb