make sure we support
This commit is contained in:
parent
159903ec95
commit
797fada848
@ -272,6 +272,16 @@ class TestCollection < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if @@version <= "1.5.1"
|
||||||
|
def test_fields_with_slice
|
||||||
|
@@test.save({:foo => [1, 2, 3, 4, 5, 6], :test => 'slice'})
|
||||||
|
|
||||||
|
doc = @@test.find_one({:test => 'slice'}, :fields => {'foo' => {'$slice' => [0, 3]}})
|
||||||
|
assert_equal [1, 2, 3], doc['foo']
|
||||||
|
@@test.remove
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_find_one
|
def test_find_one
|
||||||
id = @@test.save("hello" => "world", "foo" => "bar")
|
id = @@test.save("hello" => "world", "foo" => "bar")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user