[rspec-users] having should_receive expectation for things that happen in setup

David Chelimsky dchelimsky at gmail.com
Tue Feb 20 17:21:01 EST 2007

should_receive sets up expectations for things that will happen
subsequently. In your example, foo.msg gets called before

Make sense?

On 2/20/07, Esad Hajdarevic <esad at esse.at> wrote:
> Hi!
> The following example doesn't work for me: http://pastie.caboo.se/41732
> However, if the call to msg() happens in the specify block after the
> expecation and not in the setup, it will pass.
> Why is this? I thought the setup method was there to actually
> 'construct' the context and the specifications are some kind of
> "postconditions" that only need to be validated after that - am I
> thinking wrong here?
> Greetings,
> Esad
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list