[rspec-users] Mock and Stub objects

Amit Kulkarni lists at ruby-forum.com
Thu Jun 11 03:17:38 EDT 2009


David Chelimsky wrote:
> On Wed, Jun 10, 2009 at 5:55 AM, Amit Kulkarni<lists at ruby-forum.com> 
> wrote:
>> Hello,
>>
>> � � �I had seen many controller spec using mock and stub objects.
>>
>> � � �I had written controller spec earlier without these objects.
>>
>> � � �In the book it is mention about mock and stub objects.but i am
>> still not getting the reason behind it.
> 
> Did you read the chapter on Mock Objects?

Yes i have read Mock Objects.
I understood a bit that Mock object create objects virtually so that we 
can run our specs.It helps us in that we dont have to actually create 
those objects.

But i am still not getting my hand on it.

we may have a situation that just for instance that all the development 
is done and we are now writing the spec for it.In this case all the 
coding in controller,model are done.
So when we write specs for controller do we have to create mock objects?
What if we write specs in controller without using mock objects?Will it 
be fine?

Also since i am using the beta version Mocking Objects part is not 
there.And it is does not give clearcut idea from the topic Mock Objects.
Also it will be very helpful if you can provide me a link or anything 
which can give me details of Mocks and Stubs.How to use it?When to use 
it..e.t.c

Thanks & Regards,

Amit
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list