class RSpec::Mocks::Matchers::HaveReceived
@private
Constants
- ARGS_CONSTRAINTS
- CONSTRAINTS
- COUNT_CONSTRAINTS
Public Class Methods
# File rspec-mocks/lib/rspec/mocks/matchers/have_received.rb, line 12 def initialize(method_name, &block) @method_name = method_name @block = block @constraints = [] @subject = nil end
Public Instance Methods
# File rspec-mocks/lib/rspec/mocks/matchers/have_received.rb, line 48 def description (@expectation ||= expect).description_for("have received") end
# File rspec-mocks/lib/rspec/mocks/matchers/have_received.rb, line 32 def does_not_match?(subject) @subject = subject ensure_count_unconstrained @expectation = expect.never mock_proxy.ensure_implemented(@method_name) expected_messages_received_in_order? end
# File rspec-mocks/lib/rspec/mocks/matchers/have_received.rb, line 40 def failure_message capture_failure_message end
# File rspec-mocks/lib/rspec/mocks/matchers/have_received.rb, line 44 def failure_message_when_negated capture_failure_message end
# File rspec-mocks/lib/rspec/mocks/matchers/have_received.rb, line 19 def matcher_name "have_received" end
# File rspec-mocks/lib/rspec/mocks/matchers/have_received.rb, line 23 def matches?(subject, &block) @block ||= block @subject = subject @expectation = expect mock_proxy.ensure_implemented(@method_name) expected_messages_received_in_order? end
# File rspec-mocks/lib/rspec/mocks/matchers/have_received.rb, line 67 def setup_allowance(_subject, &_block) disallow("allow", " as it would have no effect") end
# File rspec-mocks/lib/rspec/mocks/matchers/have_received.rb, line 71 def setup_any_instance_allowance(_subject, &_block) disallow("allow_any_instance_of") end
# File rspec-mocks/lib/rspec/mocks/matchers/have_received.rb, line 75 def setup_any_instance_expectation(_subject, &_block) disallow("expect_any_instance_of") end
# File rspec-mocks/lib/rspec/mocks/matchers/have_received.rb, line 79 def setup_any_instance_negative_expectation(_subject, &_block) disallow("expect_any_instance_of") end
# File rspec-mocks/lib/rspec/mocks/matchers/have_received.rb, line 59 def setup_expectation(subject, &block) notify_failure_message unless matches?(subject, &block) end
# File rspec-mocks/lib/rspec/mocks/matchers/have_received.rb, line 63 def setup_negative_expectation(subject, &block) notify_failure_message unless does_not_match?(subject, &block) end