[rspec-users] Adding Test Spy into Rspec mocking framework

Joseph Wilk lists at ruby-forum.com
Mon Sep 15 12:54:18 EDT 2008


>Doesn't RR already support test spy?
I don't believe so. There is nothing on the github page or anything I 
can spot in the current code in git. The github docs do mention it as 
something they are aiming to do.

> o = stub("stub", :foo => true)
> o.foo
> o.should have_received(:foo)

That sounds really interesting Pat. Is is something that's living in 
github? I would be interested to see what you are coming up with when 
you get a chance to let it out into the wild.

>Now with all of that said, I think this is worth exploring. I'm just
>not sure that exploration should occur in Rspec proper. What I'd
>encourage you to do is write either a standalone library with hooks
>that you can exploit from Rspec examples and/or rspec/cucumber
>scenarios or write an extension library for Rspec's mocking framework.

Thanks for the feedback. I'll take a look at making it something outside 
of Rspec as you suggested. I'll notify the mailing list of any progress 
I make.

To follow on from David's link you can see the slides from agile 2008 
where Mockito makes an introduction 
http://szczepiq.files.wordpress.com/2008/08/dont-give-up-on-mocking.pdf

And from the creator of mockito 
http://monkeyisland.pl/2008/01/14/mockito/
(whose URL brings back good old memories.)

Have a good evening/morning/afternoon,
--
Joseph Wilk
http://www.joesniff.co.uk

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


More information about the rspec-users mailing list