minor: test fix getlasterror
This commit is contained in:
parent
0585aa1aae
commit
a20d0c5f98
|
@ -105,10 +105,11 @@ class TestCollection < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_safe_insert
|
def test_safe_insert
|
||||||
|
@@test.create_index("hello", :unique => true)
|
||||||
a = {"hello" => "world"}
|
a = {"hello" => "world"}
|
||||||
@@test.insert(a)
|
@@test.insert(a)
|
||||||
@@test.insert(a)
|
@@test.insert(a)
|
||||||
assert(@@db.get_last_error.include?("E11000"))
|
assert(@@db.get_last_error['err'].include?("11000"))
|
||||||
|
|
||||||
assert_raise OperationFailure do
|
assert_raise OperationFailure do
|
||||||
@@test.insert(a, :safe => true)
|
@@test.insert(a, :safe => true)
|
||||||
|
|
Loading…
Reference in New Issue