From 49d7bb08831760c1f15a571f4f9a847d01a31cbe Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Thu, 30 Dec 2010 15:43:35 -0500 Subject: [PATCH] minor: specify mapreduce output collection (required as of 1.7.5) --- test/collection_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/collection_test.rb b/test/collection_test.rb index 5f08a83..72f35f0 100644 --- a/test/collection_test.rb +++ b/test/collection_test.rb @@ -417,7 +417,7 @@ class TestCollection < Test::Unit::TestCase m = "function() { emit(this.user_id, 1); }" r = "function(k,vals) { return 1; }" - res = @@test.map_reduce(m, r); + res = @@test.map_reduce(m, r, :out => 'foo'); assert res.find_one({"_id" => 1}) assert res.find_one({"_id" => 2}) end @@ -428,7 +428,7 @@ class TestCollection < Test::Unit::TestCase m = Code.new("function() { emit(this.user_id, 1); }") r = Code.new("function(k,vals) { return 1; }") - res = @@test.map_reduce(m, r); + res = @@test.map_reduce(m, r, :out => 'foo'); assert res.find_one({"_id" => 1}) assert res.find_one({"_id" => 2}) end @@ -441,7 +441,7 @@ class TestCollection < Test::Unit::TestCase m = Code.new("function() { emit(this.user_id, 1); }") r = Code.new("function(k,vals) { return 1; }") - res = @@test.map_reduce(m, r, :query => {"user_id" => {"$gt" => 1}}); + res = @@test.map_reduce(m, r, :query => {"user_id" => {"$gt" => 1}}, :out => 'foo'); assert_equal 2, res.count assert res.find_one({"_id" => 2}) assert res.find_one({"_id" => 3}) @@ -450,7 +450,7 @@ class TestCollection < Test::Unit::TestCase def test_map_reduce_with_raw_response m = Code.new("function() { emit(this.user_id, 1); }") r = Code.new("function(k,vals) { return 1; }") - res = @@test.map_reduce(m, r, :raw => true) + res = @@test.map_reduce(m, r, :raw => true, :out => 'foo') assert res["result"] assert res["counts"] assert res["timeMillis"]