>> When you need to check several properties of an object, what is the
>> best way to match them all?
In the mail library I use a custom matcher, which lets me do things like:
it "should handle |Minero Aoki |" do
address = Mail::Address.new('Minero Aoki ')
address.should break_down_to({
On Mar 30, 2010, at 7:23 AM, George wrote:
> When you need to check several properties of an object, what is the
> best way to match them all?
>
> I'm using the 'satisfy' matcher at the moment but perhaps there's a
> better way than this:
> flight.should satisfy { |f|
>f.booking_code
Yep, that's a fair point and may improve readability if I set up the
compare object in a before method.
Good idea, thanks David.
George
On Mar 30, 5:43 pm, David Chelimsky wrote:
> On Mar 30, 2010, at 9:23 AM, George wrote:
>
>
>
> > When you need to check several properties of an object, what is
On Mar 30, 2010, at 9:23 AM, George wrote:
> When you need to check several properties of an object, what is the
> best way to match them all?
>
> I'm using the 'satisfy' matcher at the moment but perhaps there's a
> better way than this:
> flight.should satisfy { |f|
>f.booking_code
When you need to check several properties of an object, what is the
best way to match them all?
I'm using the 'satisfy' matcher at the moment but perhaps there's a
better way than this:
flight.should satisfy { |f|
f.booking_code== @parsed_pnr_data[:pnr_number] &&