[rspec-users] mock object in array is getting size called on it

David Chelimsky dchelimsky at gmail.com
Fri Jun 26 09:24:10 EDT 2009


On Fri, Jun 26, 2009 at 8:15 AM, doug livesey<biot023 at gmail.com> wrote:
>> Why don't you debug it and find out where the call is coming from?
>
> I get:
>
> /home/doug/work/rails/neville/vendor/gems/rspec-1.2.7/lib/spec/mocks/message_expectation.rb:171:in
> `call'
>
> That block's a very useful feature I was unaware of! ;)

Yeah - it's in the release notes, but I should really blog about it.
Maybe next year :)

Anyhow - that's the code that's calling the block I asked you to put
in there :) Doesn't help much - try going back a few frames in the
stack:

prop1 = mock(property1)
prop1.stub(:size) { puts caller(0)[1..5]; 37 }




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


More information about the rspec-users mailing list