Module | Spec::Mocks::Methods
In: | lib/spec/mocks/methods.rb

### Methods

as_null_object null_object? should_not_receive should_receive stub stub! stub_chain unstub unstub!

### Public Instance methods

as_null_object()
null_object?()
should_not_receive(sym, &block)
should_receive(sym, opts={}, &block)
stub(sym_or_hash, opts={}, &block)

Alias for stub!

stub!(sym_or_hash, opts={}, &block)
object.stub_chain(:first, :second, :third).and_return(:this)

Supports stubbing a chain of methods. Each argument represents a method name to stub, and each one returns a proxy object that can accept more stubs, until the last, which returns whatever is passed to +and_return_.

## Examples

      # with this in an example ...
      article = double('article')
      Article.stub_chain(:authored_by, :published, :recent).and_return([article])
      # then this will return an Array with the article double in it:
      Article.authored_by(params[:author_id]).published.recent

unstub(message)

Alias for unstub!

unstub!(message)

[Validate]