On 10/4/07, Eric Pugh <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have an array of shipping_type's being returned, and I want to see
> what is in there.  In the past I have done:
>
>      shipping_type.include?(Cart::SHIPPING_TYPE_REGULAR).should be_true
>
> This works, but looks really ugly..  It just doesn't roll of the
> tongue very well.  I then looked up the use of Predicates, which I
> had been using, but hadn't realized:
>
>      shipping_type.should be_include(Cart::SHIPPING_TYPE_REGULAR)

You were close on this one, it should just be

shipping_type.should include(Cart::SHIPPING_TYPE_REGULAR)

It's a special predicate just for working with arrays.

Cheers,
/Nick
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to