make sure we support

This commit is contained in:
Kyle Banker 2010-05-03 17:40:55 -04:00
parent 159903ec95
commit 797fada848
1 changed files with 10 additions and 0 deletions

View File

@ -272,6 +272,16 @@ class TestCollection < Test::Unit::TestCase
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
id = @@test.save("hello" => "world", "foo" => "bar")