[rspec-users] how can this pass?
dchelimsky at gmail.com
Sun Feb 8 22:29:59 EST 2009
On Sun, Feb 8, 2009 at 8:54 PM, Sergio Bayona <lists at ruby-forum.com> wrote:
> Aslak Hellesøy wrote:
>> On Mon, Feb 9, 2009 at 2:35 AM, Sergio Bayona <lists at ruby-forum.com>
>>> assigns[:property].should equal(mock_property)
>>> 1 example, 0 failures
>>> why zero failures? more specifically, why would :non_existing_method
>>> return mock_property?
>> Because you have stubbed the class method Property#non_existing_method
>> It doesn't make any difference whether this method is already defined
>> or not. Once the stub is set up, calls to the stubbed method will
>> return what you told it to return.
>>> and why would the assigns[:property] be equal to
>> Because your controller's #show method assigns @property with the
>> value returned from Property#non_existing_method (which you stubbed).
>>> did I eat some bad mushrooms?
>> That I don't know. Why do you think this behaviour is
> ah! okay it's starting to make sense... and the mushroom effect is
> wearing out. just kidding ;)
> Thank you guys. By the way I just bought the "Rspec Book" and it's seems
> like a great resource. It has encouraged me to learn the framework.
That's great news, thanks! If you have any constructive feedback to
provide about the book, please do so at:
> Posted via http://www.ruby-forum.com/.
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users