[rspec-users] On Mocks vs Stubs in the context of rSpec

Marcelo de Moraes Serpa celoserpa at gmail.com
Thu Jul 23 19:39:26 EDT 2009

Hello list,

>From what I could see, the lines between mocks and stubs are subtle,
but the general idea I got is that mocks set expectations and stubs
are only dummy objects/method calls. What confused me though, is that
the stub() method is an alias for mock() in
Spec::Mocks::ExampleMethods. So a stub is a mock?

Also, another thing that is confusing: You have stub and stub! methods
in the Spec::Mocks::Methods namespace, what is the difference between
Spec::Mocks::ExampleMethods#stub and Spec::Mocks::Methods#stub ?

Thanks in advance,


More information about the rspec-users mailing list