test for RUBY-152

This commit is contained in:
Kyle Banker 2010-07-13 14:49:59 -04:00
parent fc603c651e
commit f62a54416d
1 changed files with 10 additions and 0 deletions

View File

@ -439,6 +439,16 @@ class TestCollection < Test::Unit::TestCase
assert res["timeMillis"]
end
def test_map_reduce_with_output_collection
output_collection = "test-map-coll"
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, :out => output_collection)
assert_equal output_collection, res["result"]
assert res["counts"]
assert res["timeMillis"]
end
def test_allows_only_valid_keys
m = Code.new("function() { emit(this.user_id, 1); }")
r = Code.new("function(k,vals) { return 1; }")