Class: RSpec::Mocks::AnyInstance::MessageChains

### Home Classes Methods

### In Files

- lib/rspec/mocks/any_instance/message_chains.rb

### Parent

Hash

### Methods

- ::new
- #add
- #all_expectations_fulfilled?
- #has_expectation?
- #playback!
- #received_expected_message!
- #remove_stub_chains_for!
- #unfulfilled_expectations

### Class/Module Index

Quicksearch

- RSpec
- RSpec::Mocks
- RSpec::Mocks::AllowanceTarget
- RSpec::Mocks::AmbiguousReturnError
- RSpec::Mocks::AndCallOriginalImplementation
- RSpec::Mocks::AndReturnImplementation
- RSpec::Mocks::AndYieldImplementation
- RSpec::Mocks::AnyInstance
- RSpec::Mocks::AnyInstance::Chain
- RSpec::Mocks::AnyInstance::Chain::Customizations
- RSpec::Mocks::AnyInstance::ExpectationChain
- RSpec::Mocks::AnyInstance::MessageChains
- RSpec::Mocks::AnyInstance::PositiveExpectationChain
- RSpec::Mocks::AnyInstance::Recorder
- RSpec::Mocks::AnyInstance::StubChain
- RSpec::Mocks::AnyInstance::StubChainChain
- RSpec::Mocks::AnyInstanceAllowanceTarget
- RSpec::Mocks::AnyInstanceExpectationTarget
- RSpec::Mocks::ArgumentListMatcher
- RSpec::Mocks::ArgumentMatchers
- RSpec::Mocks::ArgumentMatchers::AnyArgMatcher
- RSpec::Mocks::ArgumentMatchers::AnyArgsMatcher
- RSpec::Mocks::ArgumentMatchers::BooleanMatcher
- RSpec::Mocks::ArgumentMatchers::DuckTypeMatcher
- RSpec::Mocks::ArgumentMatchers::EqualityProxy
- RSpec::Mocks::ArgumentMatchers::HashExcludingMatcher
- RSpec::Mocks::ArgumentMatchers::HashIncludingMatcher
- RSpec::Mocks::ArgumentMatchers::InstanceOf
- RSpec::Mocks::ArgumentMatchers::KindOf
- RSpec::Mocks::ArgumentMatchers::MatcherMatcher
- RSpec::Mocks::ArgumentMatchers::NoArgsMatcher
- RSpec::Mocks::ArgumentMatchers::RegexpMatcher
- RSpec::Mocks::Configuration
- RSpec::Mocks::Constant
- RSpec::Mocks::ConstantMutator
- RSpec::Mocks::ConstantMutator::BaseMutator
- RSpec::Mocks::ConstantMutator::ConstantHider
- RSpec::Mocks::ConstantMutator::DefinedConstantReplacer
- RSpec::Mocks::ConstantMutator::UndefinedConstantSetter
- RSpec::Mocks::ConstantStubber
- RSpec::Mocks::Deprecation
- RSpec::Mocks::ErrorGenerator
- RSpec::Mocks::ExampleMethods
- RSpec::Mocks::ExampleMethods::ExpectHost
- RSpec::Mocks::ExpectationTarget
- RSpec::Mocks::Implementation
- RSpec::Mocks::InstanceExec
- RSpec::Mocks::InstanceMethodStasher
- RSpec::Mocks::Matchers
- RSpec::Mocks::Matchers::HaveReceived
- RSpec::Mocks::Matchers::Receive
- RSpec::Mocks::Matchers::Receive::Customization
- RSpec::Mocks::MessageExpectation
- RSpec::Mocks::MethodDouble
- RSpec::Mocks::MethodDouble::ProcWithBlock
- RSpec::Mocks::Mock
- RSpec::Mocks::MockExpectationError
- RSpec::Mocks::OrderGroup
- RSpec::Mocks::Proxy
- RSpec::Mocks::ProxyForNil
- RSpec::Mocks::RecursiveConstMethods
- RSpec::Mocks::Space
- RSpec::Mocks::StubChain
- RSpec::Mocks::Syntax
- RSpec::Mocks::TargetBase
- RSpec::Mocks::TestDouble
- RSpec::Mocks::Version
- Marshal

No matching classes.

# RSpec::Mocks::AnyInstance::MessageChains

@private

### Public Class Methods

new() click to toggle source

    # File lib/rspec/mocks/any_instance/message_chains.rb, line 6
    def initialize
      super {|h,k| h[k] = []}
    end

### Public Instance Methods

add(method_name, chain) click to toggle source

@private

    # File lib/rspec/mocks/any_instance/message_chains.rb, line 11
    def add(method_name, chain)
      self[method_name] << chain
      chain
    end

all_expectations_fulfilled?() click to toggle source

@private

    # File lib/rspec/mocks/any_instance/message_chains.rb, line 27
    def all_expectations_fulfilled?
      all? {|method_name, chains| chains.all? {|chain| chain.expectation_fulfilled?}}
    end

has_expectation?(method_name) click to toggle source

@private

    # File lib/rspec/mocks/any_instance/message_chains.rb, line 22
    def has_expectation?(method_name)
      self[method_name].find {|chain| chain.is_a?(ExpectationChain)}
    end

playback!(instance, method_name) click to toggle source

@private

    # File lib/rspec/mocks/any_instance/message_chains.rb, line 44
    def playback!(instance, method_name)
      raise_if_second_instance_to_receive_message(instance)
      self[method_name].each {|chain| chain.playback!(instance)}
    end

received_expected_message!(method_name) click to toggle source

@private

    # File lib/rspec/mocks/any_instance/message_chains.rb, line 39
    def received_expected_message!(method_name)
      self[method_name].each {|chain| chain.expectation_fulfilled!}
    end

remove_stub_chains_for!(method_name) click to toggle source

@private

    # File lib/rspec/mocks/any_instance/message_chains.rb, line 17
    def remove_stub_chains_for!(method_name)
      self[method_name].reject! {|chain| chain.is_a?(StubChain)}
    end

unfulfilled_expectations() click to toggle source

@private

    # File lib/rspec/mocks/any_instance/message_chains.rb, line 32
    def unfulfilled_expectations
      map do |method_name, chains|
        method_name.to_s if chains.last.is_a?(ExpectationChain) unless chains.last.expectation_fulfilled?
      end.compact
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.