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.
# File lib/rspec/mocks/spec_methods.rb, line 39 def allow_message_expectations_on_nil Proxy.allow_message_expectations_on_nil end
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.
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"
# File lib/rspec/mocks/spec_methods.rb, line 21 def double(*args) declare_double('Double', *args) end
Generated with the Darkfish Rdoc Generator 2.