public
Rubygem
Description: DataMapper - Core
Homepage: http://datamapper.org
Clone URL: git://github.com/sam/dm-core.git
find by range
Adam French (author)
Tue May 20 19:17:32 -0700 2008
commit  6a5e60ed59026cf4edd0b398526fdb5614580f53
tree    b43fbecde07e7ddd643e98ed1082fbc9c15b0ea6
parent  44347090a6f9c65e2a889dc89e011d7625efa4b6
...
38
39
40
41
 
42
43
44
...
49
50
51
 
 
 
 
 
 
 
 
 
 
 
52
53
54
...
38
39
40
 
41
42
43
44
...
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
0
@@ -38,7 +38,7 @@ if HAS_SQLITE3
0
 
0
       it "should find by conditions passed in as hash" do
0
         repository(:sqlite3) do
0
-          SailBoat.create(:name => "couldbe@email.com", :port => 1)
0
+          SailBoat.create(:name => "couldbe@email.com", :port => 'wee')
0
 
0
           find = SailBoat.first(:name => 'couldbe@email.com')
0
           find.name.should == 'couldbe@email.com'
0
@@ -49,6 +49,17 @@ if HAS_SQLITE3
0
           find.name.should == 'couldbe@email.com'
0
         end
0
       end
0
+      
0
+      it "should find by conditions passed in a range" do
0
+        repository(:sqlite3) do
0
+          find = SailBoat.all(:id => (0..2))
0
+          find.should_not be_nil
0
+          find.should have(2).entries
0
+
0
+          find = SailBoat.all(:id.not => (0..2))
0
+          find.should have(1).entries
0
+        end
0
+      end
0
 
0
       it "should order results" do
0
         repository(:sqlite3) do

Comments