Commit a3c07153b04c5d8605f8c98d1d99bd50c9a5f5b6

Better Meta#first and #last specs [#1 state:resolved]

Commit diff

spec/lib/strokedb/document/meta_spec.rb

 
6969 it "should return first document if no args are passed to #first" do
7070 a = SomeName.create!(:slot1 => 1)
7171 b = SomeName.create!(:slot1 => 2)
72 SomeName.first.should == SomeName.find.first
72 a_and_b = SomeName.find
73 a_and_b.to_set.should == [a,b].to_set
74 a_and_b.member?(SomeName.first).should be_true
7375 end
7476
7577 it "correctly handles finding via UUID on call to #first" do
8888 it "should return last document if no args are passed to #last" do
8989 a = SomeName.create!(:slot1 => 1)
9090 b = SomeName.create!(:slot1 => 2)
91 SomeName.last.should == SomeName.find.last
91 a_and_b = SomeName.find
92 a_and_b.to_set.should == [a,b].to_set
93 a_and_b.member?(SomeName.last).should be_true
9294 end
9395
9496 it "correctly handles finding via UUID on call to #last" do
toggle raw diff