Permalink
Browse files

Merge pull request #3 from yaauie/fixes

A couple fixes
  • Loading branch information...
2 parents 8336c56 + af89e59 commit 36bebe7cda2dbf3652c4b7a373d2a5bff448982e Greg Brockman committed Oct 14, 2011
View
@@ -1 +1,9 @@
require "bundler/gem_tasks"
+require 'rake/testtask'
+
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'test/**/*_test.rb'
+ test.verbose = true
+end
View
@@ -29,4 +29,7 @@ Gem::Specification.new do |s|
# s.add_development_dependency "rspec"
# s.add_runtime_dependency "rest-client"
s.add_runtime_dependency "mongo"
+ s.add_development_dependency 'shoulda'
+ s.add_development_dependency 'mocha'
+ s.add_development_dependency 'rake'
end
@@ -1,8 +1,8 @@
module EmbeddedMongo
class Collection < Mongo::Collection
- def insert_documents(documents, collection_name=@name, check_keys=true, safe=false)
+ def insert_documents(documents, collection_name=@name, check_keys=true, safe=false, opts={})
# TODO: do something with check_keys / safe
- EmbeddedMongo.log.debug("insert_documents: #{documents.inspect}, #{collection_name.inspect}, #{check_keys.inspect}, #{safe.inspect}")
+ EmbeddedMongo.log.debug("insert_documents: #{documents.inspect}, #{collection_name.inspect}, #{check_keys.inspect}, #{safe.inspect}, #{opts.inspect}")
@connection.request(:insert_documents, @db.name, collection_name, documents)
end
@@ -6,17 +6,17 @@ def request(method, *args)
end
def connect
- puts "Connecting to #{@host_to_try.inspect}"
+ EmbeddedMongo.log.debug "Connecting to #{@host_to_try.inspect}"
@backend = Backend.connect_backend(@host_to_try)
end
def send_message(operation, message, log_message=nil)
- puts "Calling send_message with: #{operation.inspect}, #{message.inspect}, #{log_message.inspect}"
+ EmbeddedMongo.log.debug "Calling send_message with: #{operation.inspect}, #{message.inspect}, #{log_message.inspect}"
raise "send_message"
end
def receive_message(operation, message, log_message=nil, socket=nil, command=false)
- puts "Calling receive_message with: #{operation.inspect}, #{message.inspect}, #{log_message.inspect}, #{command.inspect}"
+ EmbeddedMongo.log.debug "Calling receive_message with: #{operation.inspect}, #{message.inspect}, #{log_message.inspect}, #{command.inspect}"
raise "receive_message"
end

0 comments on commit 36bebe7

Please sign in to comment.