test and update gemspec

This commit is contained in:
Mike Dirolf 2009-03-12 17:25:23 -04:00
parent 37044a38f5
commit ce406d92f7
2 changed files with 10 additions and 0 deletions

View File

@ -35,6 +35,7 @@ PACKAGE_FILES = ['README.rdoc', 'Rakefile', 'mongo-ruby-driver.gemspec',
'lib/mongo/mongo.rb',
'lib/mongo/query.rb',
'lib/mongo/types/binary.rb',
'lib/mongo/types/code.rb',
'lib/mongo/types/dbref.rb',
'lib/mongo/types/objectid.rb',
'lib/mongo/types/regexp_of_holding.rb',

View File

@ -442,6 +442,15 @@ class DBAPITest < Test::Unit::TestCase
assert_equal "#{@@db.host}:#{@@db.port}", @@db.master
end
def test_where
@@coll.insert('a' => 2)
@@coll.insert('a' => 3)
assert_equal 3, @@coll.count
assert_equal 1, @@coll.find('$where' => Code.new('this.a > 2')).count
assert_equal 2, @@coll.find('$where' => Code.new('this.a > i', {'i' => 1})).count
end
def test_hint
name = @@coll.create_index('a')
begin