On Dec 22, 2007 1:11 PM, Michael Schuerig <[EMAIL PROTECTED]> wrote:
> (2).should(be(2));

That's something really messed up with 'instanced' Numbers.

typeof new Number(1) //=> 'object'
new Number(1) == new Number(1) //=> false

The number to which you call 'should' will use an instance of Number,
while the other one will only be a "value" and won't have any methods.

Even worse, Object.isNumber(new Number(1)) returns false :-\ So I
redefined Object.isNumber and then hacked Matcher.Be.=== to check if
both are numbers first, in which case returns x == y.

It works now, but I'm not really sure doing that is the best approach.
If anyone has any ideas I'd be glad to hear them :)

I've uploaded this as 0.2.2.

> From the spec I get these errors in Firefox as well as Konqueror (3.5.8)
>
> # [failed]should handle failures correctly
> with: expected 2 to be > 1
> # [pending]should handle pending specs
> # [error]should handle errors correctly
> with: undefined has no properties

Yeah, those 4 were supposed to be like that (show an example of what
happens with the possible results), but I suppose I wasn't very clear
with the naming, as most people that looked at it asked me about
those. I removed them from the example and will keep them in a
separate test :)

Thanks for all the help,
-Nicolas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to