[DRE-commits] [SCM] ruby-mongo.git branch, master, updated. upstream/1.8.5-17-g80e8df7

Prach Pongpanich prachpub at gmail.com
Mon Apr 22 05:07:49 UTC 2013


The following commit has been merged in the master branch:
commit 80e8df765c97448c758621d39d93e95ab2abef0c
Author: Prach Pongpanich <prachpub at gmail.com>
Date:   Mon Apr 22 12:07:21 2013 +0700

    add upstream patch - fix unit tests require mongodb server

diff --git a/debian/patches/fix-unit-tests-require-mongodb-server.patch b/debian/patches/fix-unit-tests-require-mongodb-server.patch
new file mode 100644
index 0000000..b4f6153
--- /dev/null
+++ b/debian/patches/fix-unit-tests-require-mongodb-server.patch
@@ -0,0 +1,47 @@
+Description: RUBY-584 fixing unit tests that require a mongodb connection
+Origin: upstream
+Bug: https://jira.mongodb.org/browse/RUBY-584
+
+--- a/lib/mongo/mongo_sharded_client.rb
++++ b/lib/mongo/mongo_sharded_client.rb
+@@ -140,7 +140,8 @@ def checkout(&block)
+     # @param opts [ Hash ] Any of the options available for MongoShardedClient.new
+     #
+     # @return [ Mongo::MongoShardedClient ] The sharded client.
+-    def self.from_uri(uri = ENV['MONGODB_URI'], options = {})
++    def self.from_uri(uri, options = {})
++      uri ||= ENV['MONGODB_URI']
+       URIParser.new(uri).connection(options, false, true)
+     end
+   end
+--- a/test/unit/mongo_sharded_client_test.rb
++++ b/test/unit/mongo_sharded_client_test.rb
+@@ -9,24 +9,24 @@ def setup
+ 
+   def test_initialize_with_single_mongos_uri
+     ENV["MONGODB_URI"] = "mongodb://localhost:27017"
+-    client = MongoShardedClient.new
++    client = MongoShardedClient.new(:connect => false)
+     assert_equal [[ "localhost", 27017 ]], client.seeds
+   end
+ 
+   def test_initialize_with_multiple_mongos_uris
+     ENV["MONGODB_URI"] = "mongodb://localhost:27017,localhost:27018"
+-    client = MongoShardedClient.new
++    client = MongoShardedClient.new(:connect => false)
+     assert_equal [[ "localhost", 27017 ], [ "localhost", 27018 ]], client.seeds
+   end
+ 
+   def test_from_uri_with_string
+-    client = MongoShardedClient.from_uri("mongodb://localhost:27017,localhost:27018")
++    client = MongoShardedClient.from_uri("mongodb://localhost:27017,localhost:27018", :connect => false)
+     assert_equal [[ "localhost", 27017 ], [ "localhost", 27018 ]], client.seeds
+   end
+ 
+   def test_from_uri_with_env_variable
+     ENV["MONGODB_URI"] = "mongodb://localhost:27017,localhost:27018"
+-    client = MongoShardedClient.from_uri
++    client = MongoShardedClient.from_uri(nil, :connect => false)
+     assert_equal [[ "localhost", 27017 ], [ "localhost", 27018 ]], client.seeds
+   end
+ end
diff --git a/debian/patches/series b/debian/patches/series
index 86c426c..65dd909 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 enable_run_tests.patch
+fix-unit-tests-require-mongodb-server.patch

-- 
ruby-mongo.git



More information about the Pkg-ruby-extras-commits mailing list