[rspec-users] RSpec vs Screw.Unit

Scott Taylor mailing_lists at railsnewbie.com
Sat Oct 18 14:59:44 EDT 2008


On Oct 18, 2008, at 9:19 AM, Pat Maddox wrote:

> Scott Taylor <mailing_lists at railsnewbie.com> writes:
>
>> As for #3, I'm
>> pretty sure that Ruby's method_missing allows one to raise an
>> exception easily.  Not sure what a Javascript mocking framework would
>> do in this case.
>
> I'm not sure that I buy that this feature is very important.  Both
> Javascript and Ruby blow up when you call a method that doesn't  
> exist on
> it anyway.  What's the difference between "Received unexpected message
> 'foo'" and "NoMethodError 'foo'"?

Unless I'm mistaken, it's only when *another* method gets called on a  
missing method that an error gets raised:

 >>> o = {};
Object
 >>> o.foo
 >>> o.foo === undefined
true
 >>> o.foo.bar
TypeError: o.foo is undefined

Also, I found this last night:

http://developer.mozilla.org/En/Core_JavaScript_1.5_Reference:Global_Objects:Object:_noSuchMethod 
.

BTW, Pat - Have you still been working on integrating test spy into  
rspec?

Scott



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



More information about the rspec-users mailing list