Mark Thomas
6/12/2008 2:42:00 PM
On Jun 11, 6:31 pm, 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?