diff --git a/lib/mongo/collection.rb b/lib/mongo/collection.rb index 2e1de47..7fc0a87 100644 --- a/lib/mongo/collection.rb +++ b/lib/mongo/collection.rb @@ -260,7 +260,7 @@ module Mongo # run the operation in safe mode, which run a getlasterror command on the # database to report any assertion. In addition, a hash can be provided to # run an fsync and/or wait for replication of the remove (>= 1.5.1). See the options - # for DB#error. + # for DB#get_last_error. # # @example remove all documents from the 'users' collection: # users.remove diff --git a/lib/mongo/connection.rb b/lib/mongo/connection.rb index 411f86e..66932d9 100644 --- a/lib/mongo/connection.rb +++ b/lib/mongo/connection.rb @@ -398,7 +398,7 @@ module Mongo # @param [Hash] last_error_params parameters to be sent to getLastError. See DB#error for # available options. # - # @see DB#error for valid last error params. + # @see DB#get_last_error for valid last error params. # # @return [Array] # An array whose indexes include [0] documents returned, [1] number of document received, diff --git a/test/collection_test.rb b/test/collection_test.rb index 8636498..2faf037 100644 --- a/test/collection_test.rb +++ b/test/collection_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require './test/test_helper' class TestCollection < Test::Unit::TestCase @@connection ||= Connection.new(ENV['MONGO_RUBY_DRIVER_HOST'] || 'localhost', ENV['MONGO_RUBY_DRIVER_PORT'] || Connection::DEFAULT_PORT) diff --git a/test/connection_test.rb b/test/connection_test.rb index 46cefb5..8ea5e79 100644 --- a/test/connection_test.rb +++ b/test/connection_test.rb @@ -15,7 +15,7 @@ class TestConnection < Test::Unit::TestCase end def teardown - @mongo.db(MONGO_TEST_DB).error + @mongo[MONGO_TEST_DB].get_last_error end def test_slave_ok_with_multiple_nodes diff --git a/test/db_api_test.rb b/test/db_api_test.rb index de43e77..c3a77a5 100644 --- a/test/db_api_test.rb +++ b/test/db_api_test.rb @@ -19,7 +19,7 @@ class DBAPITest < Test::Unit::TestCase def teardown @@coll.remove - @@db.error + @@db.get_last_error end def test_clear diff --git a/test/db_test.rb b/test/db_test.rb index ea32295..5a34e2f 100644 --- a/test/db_test.rb +++ b/test/db_test.rb @@ -164,30 +164,30 @@ class DBTest < Test::Unit::TestCase def test_error @@db.reset_error_history - assert_nil @@db.error + assert_nil @@db.get_last_error['err'] assert !@@db.error? assert_nil @@db.previous_error @@db.command({:forceerror => 1}, :check_response => false) assert @@db.error? - assert_not_nil @@db.error + assert_not_nil @@db.get_last_error['err'] assert_not_nil @@db.previous_error @@db.command({:forceerror => 1}, :check_response => false) assert @@db.error? - assert @@db.error + assert @@db.get_last_error['err'] prev_error = @@db.previous_error assert_equal 1, prev_error['nPrev'] - assert_equal prev_error["err"], @@db.error + assert_equal prev_error["err"], @@db.get_last_error['err'] @@db.collection('test').find_one - assert_nil @@db.error + assert_nil @@db.get_last_error['err'] assert !@@db.error? assert @@db.previous_error assert_equal 2, @@db.previous_error['nPrev'] @@db.reset_error_history - assert_nil @@db.error + assert_nil @@db.get_last_error['err'] assert !@@db.error? assert_nil @@db.previous_error end