[rspec-users] Mocks? Really?

David Chelimsky dchelimsky at gmail.com
Fri Dec 7 21:40:15 EST 2007

On Dec 7, 2007 8:30 PM, Priit Tamboom <priit at mx.ee> wrote:
> Hi!
> > > This is handy and keeps the view test isolated from changes to your
> > > models, but is that really the point?
> I was very confused first as well. It didn't make any point to me and
> I'm not using it at all. As far as I know, I take it as an optional
> tool to go nuts with views when needed. I will use it when some stuff
> in view becomes super important to be there. However as an one-band
> project I haven't feel this need yet.
> Second thing is about how you like to develop your stuff. As far as I
> know David start with Story -> Views -> controller -> model. I prefer
> to go this way: Story -> model/controller -> views. So now you might
> guess why specing views are nice thing when you go David's way
> up-to-down.
> Anyhow, mocking in controllers (and in views) makes much more sense
> now with story runner in the big picture. General stuff 'does it work
> at all' goes to story runner and specific low level stuff goes to
> spec. So it's up to you if you care about low level stuff in views.
> One thing what I still don't like so much is that rspec "force" you to
> develop things super vertically or otherwise your mocks will be out of
> sync very quickly. Correct me if I'm wrong !!!

RSpec doesn't force you to anything at all. However, the agile
approach tends to be vertical slices in short iterations. Working
outside-in, using mocks, etc all ties in with that thinking.

But rspec is certainly not going to throw errors at you if you decide
to write your entire model layer first.

> Oki,
> Priit
> PS. somehow autotest does not pick up stories to run. I haven't yet
> investigate it why.

This is by design. Autotest supports the TDD process - rapid
iterations of red/green/refactor. Having them run your stories too
would slow things down considerably.

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

More information about the rspec-users mailing list