On 07/08/2008, at 05:04 , Jonathan Linowes wrote:
> .should be_bag_of( [1, 3, 1, 4, 2] )
+1
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Would such a matcher also work in this instance:
Car.should_receive(:find).with([EMAIL PROTECTED], @fiat.id])
Such that if I don't know (or care) what order the IDs will be passed to
the find method, this will pass?
Or is there already some other way to achieve that?
--
Posted via http://www.r
Zach Dennis wrote:
[1, 2, 3, 4, 1].should consist_of([1, 3, 1, 4, 2])
+1
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
i wrote this matcher myself for a project i'm working on and have been
calling it `equals_without_regard_to_order'. it's an unwieldy name
and i've never really been comfortable with it but i've continued to
use it, mostly because i'm dim.
very curious to find a winning replacement on this list!
is_permutation_of would be technically correct, but it doesn't really
express equality to me, which is the intent of the match.
///ark
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
TECTED] On Behalf Of Kyle Hargraves
Sent: Thursday, August 07, 2008 8:17 AM
To: rspec-users
Subject: Re: [rspec-users] Someone please name this matcher for me
On Wed, Aug 6, 2008 at 1:25 PM, Cohen, Joseph <[EMAIL PROTECTED]> wrote:
>
> Consider:
> should_have_the_same_member
On Wed, Aug 6, 2008 at 1:25 PM, Cohen, Joseph <[EMAIL PROTECTED]> wrote:
>
> Consider:
> should_have_the_same_members_as
Similarly, I have a have_same_elements_as(arr) matcher.
k
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.or
On 07/08/2008, at 05:04 , Jonathan Linowes wrote:
.should be_bag_of( [1, 3, 1, 4, 2] )
FWIW, I am in favour of this naming. Now back to lurking :)
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-user
2008-08-06 13:11, Mike Vincent:
> > [1, 2, 3, 4, 1].should ... [1, 3, 1, 4, 2]
> [1, 2, 3, 4, 1].should include_all [1, 3, 1, 4, 2]
I'd then think that
[1, 1, 1, 2, 3, 4].should include_all [1, 3, 1, 4, 2]
[1, 2, 3, 4, 5, 6].should include_all [1, 3, 1, 4, 2]
Which afaik was not what Pat ha
2008-08-06 14:33, Steve Schafer:
> An unordered collection with possibly multiple occurrences of its
> members is known in mathematics as a "multiset," or, informally, a
> "bag."
I (standing knee-deep in mathematics) was about to offer the following
be_multiset_equal_to
be_set_equal_to
Set e
.should be_bag_of( [1, 3, 1, 4, 2] )
On Aug 6, 2008, at 2:33 PM, Steve Schafer wrote:
On Wed, 6 Aug 2008 13:50:27 -0400, you wrote:
I've had a matcher in my head for a couple months, that I frequently
want but never get around to writing because I can't think of the
name
for it. Here's ho
How about
[1, 2, 3, 4, 1].should contain([1, 3, 1, 4, 2])
[1, 2, 3, 4, 1].should contain_only([1, 3, 1, 4, 2])
or (riffing off Zach)
[1, 2, 3, 4, 1].should be_composed_from([1, 3, 1, 4, 2])
Matt
--
Posted via http://www.ruby-forum.com/.
___
rspec-us
On Wed, 6 Aug 2008 13:50:27 -0400, you wrote:
>I've had a matcher in my head for a couple months, that I frequently
>want but never get around to writing because I can't think of the name
>for it. Here's how it would look
>
>[1, 2, 3, 4, 1].should ... [1, 3, 1, 4, 2]
An unordered collection with
Consider:
should_have_the_same_members_as
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Zach Dennis
Sent: Wednesday, August 06, 2008 11:15 AM
To: rspec-users
Subject: Re: [rspec-users] Someone please name this matcher for me
On Wed, Aug 6, 2008 at 1
On Wed, Aug 6, 2008 at 12:50 PM, Pat Maddox <[EMAIL PROTECTED]> wrote:
> I've had a matcher in my head for a couple months, that I frequently
> want but never get around to writing because I can't think of the name
> for it. Here's how it would look
>
> [1, 2, 3, 4, 1].should ... [1, 3, 1, 4, 2]
On Wed, Aug 6, 2008 at 1:50 PM, Pat Maddox <[EMAIL PROTECTED]> wrote:
> I've had a matcher in my head for a couple months, that I frequently
> want but never get around to writing because I can't think of the name
> for it. Here's how it would look
>
> [1, 2, 3, 4, 1].should ... [1, 3, 1, 4, 2]
>
perhaps verbose but how about
foo.should equal_in_any_order [1, 3, 1, 4, 2]
On Aug 6, 2008, at 1:50 PM, Pat Maddox wrote:
I've had a matcher in my head for a couple months, that I frequently
want but never get around to writing because I can't think of the name
for it. Here's how it
17 matches
Mail list logo