Class: FlexMock::RSpecMatchers::HaveReceived

### Home Classes Methods

### In Files

- lib/flexmock/rspec_spy_matcher.rb

### Parent

Object

### Methods

- ::new
- #and
- #construct_options
- #description
- #failure_message_for_should
- #failure_message_for_should_not
- #matches?
- #never
- #on
- #once
- #times
- #twice
- #with
- #with_a_block
- #without_a_block

### Included Modules

- FlexMock::SpyDescribers

### Files

- CHANGES
- GoogleExample.rdoc
- rspec_examples_spec.rdoc
- test_unit_examples_test.rdoc
- index.rdoc
- flexmock-0.4.0.rdoc
- flexmock-0.4.1.rdoc
- flexmock-0.4.2.rdoc
- flexmock-0.4.3.rdoc
- flexmock-0.5.0.rdoc
- flexmock-0.5.1.rdoc
- flexmock-0.6.0.rdoc
- flexmock-0.6.1.rdoc
- flexmock-0.6.2.rdoc
- flexmock-0.6.3.rdoc
- flexmock-0.6.4.rdoc
- flexmock-0.7.0.rdoc
- flexmock-0.7.1.rdoc
- flexmock-0.8.0.rdoc
- flexmock-0.8.2.rdoc
- flexmock-0.8.3.rdoc
- flexmock-0.8.4.rdoc
- flexmock-0.8.5.rdoc
- flexmock-0.9.0.rdoc
- flexmock-1.0.0.rdoc
- flexmock-1.0.3.rdoc
- flexmock-1.0.4.rdoc
- flexmock-1.1.0.rdoc
- flexmock-1.2.0.rdoc
- flexmock-1.3.0.rdoc
- flexmock-1.3.1.rdoc

### Class/Module Index

Quicksearch

- FlexMock
- FlexMock::AnyMatcher
- FlexMock::ArgumentMatching
- FlexMock::ArgumentTypes
- FlexMock::AtLeastCountValidator
- FlexMock::AtMostCountValidator
- FlexMock::CallValidator
- FlexMock::CompositeExpectation
- FlexMock::CountValidator
- FlexMock::DefaultFrameworkAdapter
- FlexMock::DefaultFrameworkAdapter::AssertionFailedError
- FlexMock::DuckMatcher
- FlexMock::EqualMatcher
- FlexMock::ExactCountValidator
- FlexMock::Expectation
- FlexMock::ExpectationBuilder
- FlexMock::ExpectationDirector
- FlexMock::ExpectationRecorder
- FlexMock::ExplicitNeeded
- FlexMock::ExtensionRegistry
- FlexMock::Extensions
- FlexMock::Extensions::ActiveRecordModel
- FlexMock::GenericTestCase
- FlexMock::HashMatcher
- FlexMock::MockBuilder
- FlexMock::MockContainer
- FlexMock::MockError
- FlexMock::OptionalProcMatcher
- FlexMock::Ordering
- FlexMock::PartialMockProxy
- FlexMock::ProcMatcher
- FlexMock::RSpecFrameworkAdapter
- FlexMock::RSpecFrameworkAdapter::AssertionFailedError
- FlexMock::RSpecMatchers
- FlexMock::RSpecMatchers::HaveReceived
- FlexMock::Recorder
- FlexMock::SpyDescribers
- FlexMock::TestCase
- FlexMock::TestUnitAssertions
- FlexMock::TestUnitFrameworkAdapter
- FlexMock::Undefined
- FlexMock::UsageError
- FlexMock::UseContainer
- FlexMock::Version
- MiniTest
- MiniTest::Unit
- MiniTest::Unit::TestCase
- Test
- Test::Unit
- Test::Unit::TestCase
- Class
- Module
- Object
- Symbol

No matching classes.

# 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
      @additional_validations = []
    end

### Public Instance Methods

and(&block) click to toggle source

    # File lib/flexmock/rspec_spy_matcher.rb, line 73
    def and(&block)
      @additional_validations << block
      self
    end

construct_options() click to toggle source

    # File lib/flexmock/rspec_spy_matcher.rb, line 78
    def construct_options
      {
        :times      => @times,
        :with_block => @needs_block,
        :on_count   => @on_count,
        :and        => @additional_validations,
      }
    end

description() click to toggle source

    # File lib/flexmock/rspec_spy_matcher.rb, line 32
    def description
      spy_description(@spy, @method_name, @args, @options)
    end

failure_message_for_should() click to toggle source

    # File lib/flexmock/rspec_spy_matcher.rb, line 24
    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 28
    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 18
    def matches?(spy)
      @spy = spy
      @options = construct_options
      @spy.flexmock_received?(@method_name, @args, @options)
    end

never() click to toggle source

    # File lib/flexmock/rspec_spy_matcher.rb, line 56
    def never
      times(0)
    end

on(on_count) click to toggle source

    # File lib/flexmock/rspec_spy_matcher.rb, line 68
    def on(on_count)
      @on_count = on_count
      self
    end

once() click to toggle source

    # File lib/flexmock/rspec_spy_matcher.rb, line 60
    def once
      times(1)
    end

times(n) click to toggle source

    # File lib/flexmock/rspec_spy_matcher.rb, line 51
    def times(n)
      @times = n
      self
    end

twice() click to toggle source

    # File lib/flexmock/rspec_spy_matcher.rb, line 64
    def twice
      times(2)
    end

with(*args) click to toggle source

    # File lib/flexmock/rspec_spy_matcher.rb, line 36
    def with(*args)
      @args = args
      self
    end

with_a_block() click to toggle source

    # File lib/flexmock/rspec_spy_matcher.rb, line 41
    def with_a_block
      @needs_block = true
      self
    end

without_a_block() click to toggle source

    # File lib/flexmock/rspec_spy_matcher.rb, line 46
    def without_a_block
      @needs_block = false
      self
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.