| Module | RSpec::Mocks::ExampleMethods |
| In: |
lib/rspec/mocks/example_methods.rb
|
Disables warning messages about expectations being set on nil.
By default warning messages are issued when expectations are set on nil. This is to prevent false-positives and to catch potential bugs early on.
Creates an instance of RSpec::Mocks::Mock.
`name` is used for failure reporting, so you should use the role that the mock is playing in the example.
Use `stubs` to declare one or more method stubs in one statement.
@example
book = double("book", :title => "The RSpec Book")
book.title #=> "The RSpec Book"
card = double("card", :suit => "Spades", :rank => "A")
card.suit #=> "Spades"
card.rank #=> "A"