From 2121d6c80938d0084d77ea444a7e7edf223d79ef Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Fri, 2 Jul 2010 17:24:45 -0400 Subject: [PATCH] minor: cleaner output for cursor inspect --- lib/mongo/cursor.rb | 6 ++++++ test/cursor_test.rb | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/lib/mongo/cursor.rb b/lib/mongo/cursor.rb index 41d5962..7a58246 100644 --- a/lib/mongo/cursor.rb +++ b/lib/mongo/cursor.rb @@ -275,6 +275,12 @@ module Mongo :timeout => @timeout } end + # Clean output for inspect. + def inspect + "" + end + private # Convert the +:fields+ parameter from a single field name or an array diff --git a/test/cursor_test.rb b/test/cursor_test.rb index eec9ad8..be5e317 100644 --- a/test/cursor_test.rb +++ b/test/cursor_test.rb @@ -17,6 +17,13 @@ class CursorTest < Test::Unit::TestCase @@coll_full_name = "#{MONGO_TEST_DB}.test" end + def test_inspect + selector = {:a => 1} + cursor = @@coll.find(selector) + assert_equal "", cursor.inspect + end + def test_explain cursor = @@coll.find('a' => 1) explaination = cursor.explain