Afficher un message
Vieux 12/06/2008, 16h42   #5
Mark Thomas
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: rspec and inequalities?

On Jun 11, 6:31pm, Rick DeNatale <rick.denat...@gmail.com> wrote:
> > Thanks! Is this syntactic sugar for all be_xxx methods?

>
> No.
>
> 1.should be > 0
> will work, but say:
>
> 1.should be_false > 0
>
> will fail when RSpec tries to send #:0? to 1. One might say that this is an
> rspec bug, but I'd say that 1.should be_false > 0 is nonsensical, so who
> cares.


Actually, what I meant is can
item.should be_valid

be replaced with
item.should be valid

but now that I think about it, rspec probably does some method_missing
magic with the be_ prefix and wouldn't know to use #valid? with the
question mark. Maybe the equivalent is

item.should be valid?
  Réponse avec citation
 
Page generated in 0,05388 seconds with 9 queries