Sha256: 110042bf7b4ae9fc25b21a52cdb27e6585b74950e68a0a51955f41be94bfb95b

Contents?: true

Size: 568 Bytes

Versions: 14

Compression:

Stored size: 568 Bytes

Contents

require 'mocha/expectation'

module Mocha # :nodoc:
  # Extends Mocha::Expectation to record the full arguments and count whenver a
  # stubbed or mocked method is invoked.
  class Expectation # :nodoc:
    attr_accessor :invocation_count

    def invoke_with_args(args, &block)
      Mockery.instance.invocation(@mock, method_name, args)
      invoke_without_args(&block)
    end

    alias_method :invoke_without_args, :invoke
    alias_method :invoke, :invoke_with_args

    private

    def method_name
      @method_matcher.expected_method_name
    end
  end
end

Version data entries

14 entries across 14 versions & 4 rubygems

Version Path
challah-1.0.0.beta vendor/bundle/gems/bourne-1.1.2/lib/bourne/expectation.rb
bourne-1.3.2 lib/bourne/expectation.rb
challah-0.9.1.beta.3 vendor/bundle/gems/bourne-1.1.2/lib/bourne/expectation.rb
devise_sociable-0.1.0 vendor/bundle/gems/bourne-1.1.2/lib/bourne/expectation.rb
challah-0.9.1.beta vendor/bundle/gems/bourne-1.1.2/lib/bourne/expectation.rb
challah-0.9.0 vendor/bundle/gems/bourne-1.1.2/lib/bourne/expectation.rb
bourne-1.3.0 lib/bourne/expectation.rb
bourne-1.2.1 lib/bourne/expectation.rb
bourne-1.2.0 lib/bourne/expectation.rb
bourne-1.1.2 lib/bourne/expectation.rb
bourne-1.1.1 lib/bourne/expectation.rb
bourne-1.1.0 lib/bourne/expectation.rb
opsb-bourne-1.0 lib/bourne/expectation.rb
bourne-1.0 lib/bourne/expectation.rb