method
double
1.3.1 -
Show latest stable
- Class:
Spec::Mocks::ExampleMethods
double(*args)public
Shortcut for creating an instance of Spec::Mocks::Mock.
name is used for failure reporting, so you should use the role that the double is playing in the example.
stubs_and_options lets you assign options and stub values at the same time. The only option available is :null_object. Anything else is treated as a stub value.
Examples
thing = double("thing", :a => "A") thing.a == "A" => true person = double("thing", :name => "Joe", :email => "[email protected]") person.name => "Joe" person.email => "[email protected]"