| UnsupportedMatcherError | = | Class.new(StandardError) | ||
| NegationUnsupportedError | = | Class.new(StandardError) | ||
| ConstantStubber | = | ConstantMutator | Keeps backwards compatibility since we had released an rspec-mocks that only supported stubbing. Later, we released the hide_const feature and decided that the term "mutator" was a better term to wrap up the concept of both stubbing and hiding. | |
| KERNEL_METHOD_METHOD | = | ::Kernel.instance_method(:method) | @api private | |
| IGNORED_BACKTRACE_LINE | = | 'this backtrace line is ignored' | @private |
| space | [RW] |
Adds an allowance (stub) on `subject`
@param subject the subject to which the message will be added @param message a symbol, representing the message that will be
added.
@param opts a hash of options, :expected_from is used to set the
original call site
@param block an optional implementation for the allowance
@example Defines the implementation of `foo` on `bar`, using the passed block
x = 0
RSpec::Mocks.allow_message(bar, :foo) { x += 1 }
Sets a message expectation on `subject`. @param subject the subject on which the message will be expected @param message a symbol, representing the message that will be
expected.
@param opts a hash of options, :expected_from is used to set the
original call site
@param block an optional implementation for the expectation
@example Expect the message `foo` to receive `bar`, then call it
RSpec::Mocks.expect_message(bar, :foo) bar.foo