Re: [rspec-users] Using Predicates to look at an array..

2007-10-04 Thread David Chelimsky
On 10/4/07, Scott Taylor <[EMAIL PROTECTED]> wrote: > > On Oct 4, 2007, at 12:46 PM, Nick Sieger wrote: > > > 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:

Re: [rspec-users] Using Predicates to look at an array..

2007-10-04 Thread Scott Taylor
On Oct 4, 2007, at 12:46 PM, Nick Sieger wrote: > 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).sh

Re: [rspec-users] Using Predicates to look at an array..

2007-10-04 Thread David Chelimsky
On 10/4/07, Geoffrey Wiseman <[EMAIL PROTECTED]> wrote: > On 10/4/07, Eric Pugh <[EMAIL PROTECTED]> wrote: > > shipping_type.should > be_include(Cart::SHIPPING_TYPE_REGULAR) > > This is what I usually do; I agree the syntax of be_include looks odd, as is > true for some other predicates. > > O

Re: [rspec-users] Using Predicates to look at an array..

2007-10-04 Thread Geoffrey Wiseman
On 10/4/07, Eric Pugh <[EMAIL PROTECTED]> wrote: > > shipping_type.should be_include(Cart::SHIPPING_TYPE_REGULAR) This is what I usually do; I agree the syntax of be_include looks odd, as is true for some other predicates. OTOH, it's hard to find a formulation that works well for all predi

Re: [rspec-users] Using Predicates to look at an array..

2007-10-04 Thread Nick Sieger
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 j

[rspec-users] Using Predicates to look at an array..

2007-10-04 Thread Eric Pugh
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 u