[rspec-users] stubbing with and without a string

David Chelimsky dchelimsky at gmail.com
Fri Apr 20 11:29:29 EDT 2007

On 4/20/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:
> What is the difference between these two ways of mocking (with and
> without the string):
> mock('Object')
> and
> mock(Object)
> ?
> Scott

IIRC, using the #mock method, there is really no difference (are you
observing any difference?). Using the Spec::Rails mock_model method,
you must use the class instead of a String.

There *was* talk at one point of adding a feature that would allow you
to run examples w/ a command line switch that would look for all the
mocks created w/ mock(Type) and report back if the type didn't
actually support the expected methods. But that's not present so
there's really no diff now.

> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list