diff --git a/Rakefile b/Rakefile index 53fdf76..48e1df6 100644 --- a/Rakefile +++ b/Rakefile @@ -4,5 +4,5 @@ task :default => [:test] # NOTE: some of the tests assume Mongo is running Rake::TestTask.new do |t| - t.test_files = FileList['tests/test*.rb'] + t.test_files = FileList['tests/test*.rb'] end diff --git a/examples/demo.rb b/examples/demo.rb index c1e1de5..a777862 100644 --- a/examples/demo.rb +++ b/examples/demo.rb @@ -13,4 +13,8 @@ coll.insert(doc) doc = {'a' => 2} coll.insert(doc) +doc = {'a' => 3} +coll.insert(doc) + +puts coll.count() coll.find().each { |doc| puts doc.inspect } diff --git a/lib/mongo/db.rb b/lib/mongo/db.rb index a3f6a64..214ebe1 100644 --- a/lib/mongo/db.rb +++ b/lib/mongo/db.rb @@ -112,7 +112,7 @@ module XGen doc = db_command(:count => collection, :query => selector) o = doc['ok'] return doc['n'].to_i if o.to_i == 1 - raise "Error with count command: #{doc.to_s}" unless o.kind_of?(Numeric) + raise "Error with count command: #{doc.inspect}" end def drop_index(collection, name)