Parent

Included Modules

FlexMock::RSpecMatchers::HaveReceived

Public Class Methods

new(method_name) click to toggle source
# File lib/flexmock/rspec_spy_matcher.rb, line 9
def initialize(method_name)
  @method_name = method_name
  @args = nil
  @block = nil
  @times = nil
  @needs_block = nil
end

Public Instance Methods

failure_message_for_should() click to toggle source
# File lib/flexmock/rspec_spy_matcher.rb, line 25
def failure_message_for_should
  describe_spy_expectation(@spy, @method_name, @args, @options)
end
failure_message_for_should_not() click to toggle source
# File lib/flexmock/rspec_spy_matcher.rb, line 29
def failure_message_for_should_not
  describe_spy_negative_expectation(@spy, @method_name, @args, @options)
end
matches?(spy) click to toggle source
# File lib/flexmock/rspec_spy_matcher.rb, line 17
def matches?(spy)
  @spy = spy
  @options = {}
  @options[:times] = @times if @times
  @options[:with_block] = @needs_block unless @needs_block.nil?
  @spy.flexmock_received?(@method_name, @args, @options)
end
never() click to toggle source
# File lib/flexmock/rspec_spy_matcher.rb, line 53
def never
  times(0)
end
once() click to toggle source
# File lib/flexmock/rspec_spy_matcher.rb, line 57
def once
  times(1)
end
times(n) click to toggle source
# File lib/flexmock/rspec_spy_matcher.rb, line 48
def times(n)
  @times = n
  self
end
twice() click to toggle source
# File lib/flexmock/rspec_spy_matcher.rb, line 61
def twice
  times(2)
end
with(*args) click to toggle source
# File lib/flexmock/rspec_spy_matcher.rb, line 33
def with(*args)
  @args = args
  self
end
with_a_block() click to toggle source
# File lib/flexmock/rspec_spy_matcher.rb, line 38
def with_a_block
  @needs_block = true
  self
end
without_a_block() click to toggle source
# File lib/flexmock/rspec_spy_matcher.rb, line 43
def without_a_block
  @needs_block = false
  self
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.