More tests. Expanded README.

This commit is contained in:
Jim Menard 2008-12-01 20:20:00 -05:00
parent a181a9415e
commit 011bf0a51c
3 changed files with 63 additions and 1 deletions

50
README
View File

@ -1 +1,49 @@
This is a simple pure-Ruby driver for the 10gen MongoDB.
= Introduction
This is a simple pure-Ruby driver for the 10gen Mongo DB. For more information
about Mongo, see http://www.mongodb.org.
= Demo
$ ruby examples/demo.rb
Mongo must be running, of course.
= Testing
$ rake test
The tests assume that the Mongo database is running on the default port.
= License
== Mongo Ruby Driver
Copyright (C) 2008 10gen Inc.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
details.
See http://www.gnu.org/licenses/ for a copy of the GNU Affero General Public
License.
== UUID
This driver uses the UUID generator by Assaf Arkin and Eric Hodel, which uses
the MIT license (see the top of the file lib/mongo/util/uuid.rb).
== MAC Address Finder
This driver uses the MAC address finder found at
http://codeforpeople.com/lib/ruby/macaddr/macaddr-1.0.0/lib/macaddr.rb, which
uses Ruby's license (see http://codeforpeople.com/lib/license.txt).
# Local Variables:
# mode:rdoc
# End:

View File

@ -1,3 +1,4 @@
# From http://github.com/assaf/uuid/tree/master
#
# = uuid.rb - UUID generator
#

View File

@ -21,4 +21,17 @@ class DBAPITest < Test::Unit::TestCase
@coll.clear
assert_equal 0, @coll.count
end
def test_insert
@coll.insert('a' => 1)
@coll.insert('a' => 2)
@coll.insert('b' => 3)
assert_equal 3, @coll.count
docs = @coll.find().collect
assert_equal 3, docs.length
assert docs.include?('a' => 1)
assert docs.include?('a' => 2)
assert docs.include?('b' => 3)
end
end