Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A couple fixes #3

Merged
merged 3 commits into from over 2 years ago

2 participants

Ryan Biesemeyer Greg Brockman
Ryan Biesemeyer

These should be self-explanatory from their commit messages.

  1. fix an incompatibility with Mongo 1.4.0
  2. update gemspec to reflect actual dev dependencies and add rake test task
  3. use the log method in EmbeddedMongo::Connection
Greg Brockman gdb merged commit 36bebe7 into from October 13, 2011
Greg Brockman gdb closed this October 13, 2011
Greg Brockman
Owner
gdb commented October 13, 2011

LGTM. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
8  Rakefile
... ...
@@ -1 +1,9 @@
1 1
 require "bundler/gem_tasks"
  2
+require 'rake/testtask'
  3
+
  4
+require 'rake/testtask'
  5
+Rake::TestTask.new(:test) do |test|
  6
+  test.libs << 'lib' << 'test'
  7
+  test.pattern = 'test/**/*_test.rb'
  8
+  test.verbose = true
  9
+end
3  embedded-mongo.gemspec
@@ -29,4 +29,7 @@ Gem::Specification.new do |s|
29 29
   # s.add_development_dependency "rspec"
30 30
   # s.add_runtime_dependency "rest-client"
31 31
   s.add_runtime_dependency "mongo"
  32
+  s.add_development_dependency 'shoulda'
  33
+  s.add_development_dependency 'mocha'
  34
+  s.add_development_dependency 'rake'
32 35
 end
4  lib/embedded-mongo/collection.rb
... ...
@@ -1,8 +1,8 @@
1 1
 module EmbeddedMongo
2 2
   class Collection < Mongo::Collection
3  
-    def insert_documents(documents, collection_name=@name, check_keys=true, safe=false)
  3
+    def insert_documents(documents, collection_name=@name, check_keys=true, safe=false, opts={})
4 4
       # TODO: do something with check_keys / safe
5  
-      EmbeddedMongo.log.debug("insert_documents: #{documents.inspect}, #{collection_name.inspect}, #{check_keys.inspect}, #{safe.inspect}")
  5
+      EmbeddedMongo.log.debug("insert_documents: #{documents.inspect}, #{collection_name.inspect}, #{check_keys.inspect}, #{safe.inspect}, #{opts.inspect}")
6 6
       @connection.request(:insert_documents, @db.name, collection_name, documents)
7 7
     end
8 8
 
6  lib/embedded-mongo/connection.rb
@@ -6,17 +6,17 @@ def request(method, *args)
6 6
     end
7 7
 
8 8
     def connect
9  
-      puts "Connecting to #{@host_to_try.inspect}"
  9
+      EmbeddedMongo.log.debug "Connecting to #{@host_to_try.inspect}"
10 10
       @backend = Backend.connect_backend(@host_to_try)
11 11
     end
12 12
 
13 13
     def send_message(operation, message, log_message=nil)
14  
-      puts "Calling send_message with: #{operation.inspect}, #{message.inspect}, #{log_message.inspect}"
  14
+      EmbeddedMongo.log.debug "Calling send_message with: #{operation.inspect}, #{message.inspect}, #{log_message.inspect}"
15 15
       raise "send_message"
16 16
     end
17 17
 
18 18
     def receive_message(operation, message, log_message=nil, socket=nil, command=false)
19  
-      puts "Calling receive_message with: #{operation.inspect}, #{message.inspect}, #{log_message.inspect}, #{command.inspect}"
  19
+      EmbeddedMongo.log.debug "Calling receive_message with: #{operation.inspect}, #{message.inspect}, #{log_message.inspect}, #{command.inspect}"
20 20
       raise "receive_message"
21 21
     end
22 22
 
0  test/functional/test_interface.rb → test/functional/interface_test.rb
File renamed without changes
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.