From a3c07153b04c5d8605f8c98d1d99bd50c9a5f5b6 Mon Sep 17 00:00:00 2001 From: Yurii Rashkovskii Date: Wed, 30 Apr 2008 11:02:36 +0300 Subject: [PATCH] Better Meta#first and #last specs [#1 state:resolved] --- spec/lib/strokedb/document/meta_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/lib/strokedb/document/meta_spec.rb b/spec/lib/strokedb/document/meta_spec.rb index bb0227db..cf5311a8 100644 --- a/spec/lib/strokedb/document/meta_spec.rb +++ b/spec/lib/strokedb/document/meta_spec.rb @@ -69,7 +69,9 @@ it "should return first document if no args are passed to #first" do a = SomeName.create!(:slot1 => 1) b = SomeName.create!(:slot1 => 2) - SomeName.first.should == SomeName.find.first + a_and_b = SomeName.find + a_and_b.to_set.should == [a,b].to_set + a_and_b.member?(SomeName.first).should be_true end it "correctly handles finding via UUID on call to #first" do @@ -86,7 +88,9 @@ it "should return last document if no args are passed to #last" do a = SomeName.create!(:slot1 => 1) b = SomeName.create!(:slot1 => 2) - SomeName.last.should == SomeName.find.last + a_and_b = SomeName.find + a_and_b.to_set.should == [a,b].to_set + a_and_b.member?(SomeName.last).should be_true end it "correctly handles finding via UUID on call to #last" do