Add parenthesis where Ruby thinks they're a good idea

This commit is contained in:
Wojciech Piekutowski 2011-02-20 17:19:14 +01:00
parent 80a44efb68
commit 4ea7a14608
4 changed files with 15 additions and 15 deletions

View File

@ -35,7 +35,7 @@ class TestConnection < Test::Unit::TestCase
end
def test_server_version
assert_match /\d\.\d+(\.\d+)?/, @conn.server_version.to_s
assert_match(/\d\.\d+(\.\d+)?/, @conn.server_version.to_s)
end
def test_invalid_database_names

View File

@ -40,11 +40,11 @@ class ConversionsTest < Test::Unit::TestCase
end
def test_sort_value_when_value_is_negative_one
assert_equal -1, sort_value(-1)
assert_equal(-1, sort_value(-1))
end
def test_sort_value_when_value_is_negative_one_as_a_string
assert_equal -1, sort_value("-1")
assert_equal(-1, sort_value("-1"))
end
def test_sort_value_when_value_is_ascending
@ -80,35 +80,35 @@ class ConversionsTest < Test::Unit::TestCase
end
def test_sort_value_when_value_is_descending
assert_equal -1, sort_value("descending")
assert_equal(-1, sort_value("descending"))
end
def test_sort_value_when_value_is_desc
assert_equal -1, sort_value("desc")
assert_equal(-1, sort_value("desc"))
end
def test_sort_value_when_value_is_uppercase_descending
assert_equal -1, sort_value("DESCENDING")
assert_equal(-1, sort_value("DESCENDING"))
end
def test_sort_value_when_value_is_uppercase_desc
assert_equal -1, sort_value("DESC")
assert_equal(-1, sort_value("DESC"))
end
def test_sort_value_when_value_is_symbol_descending
assert_equal -1, sort_value(:descending)
assert_equal(-1, sort_value(:descending))
end
def test_sort_value_when_value_is_symbol_desc
assert_equal -1, sort_value(:desc)
assert_equal(-1, sort_value(:desc))
end
def test_sort_value_when_value_is_uppercase_symbol_descending
assert_equal -1, sort_value(:DESCENDING)
assert_equal(-1, sort_value(:DESCENDING))
end
def test_sort_value_when_value_is_uppercase_symbol_desc
assert_equal -1, sort_value(:DESC)
assert_equal(-1, sort_value(:DESC))
end
def test_sort_value_when_value_is_invalid

View File

@ -120,7 +120,7 @@ class CursorTest < Test::Unit::TestCase
results = @@coll.find.sort([:n, :asc]).to_a
assert_equal MinKey.new, results[0]['n']
assert_equal -1000000, results[1]['n']
assert_equal(-1000000, results[1]['n'])
assert_equal 1000000, results[2]['n']
assert_equal MaxKey.new, results[3]['n']
end

View File

@ -26,7 +26,7 @@ class DBTest < Test::Unit::TestCase
@@db.collection('test').insert('a' => 1)
fail "expected 'NilClass' exception"
rescue => ex
assert_match /NilClass/, ex.to_s
assert_match(/NilClass/, ex.to_s)
ensure
@@db = standard_connection.db(MONGO_TEST_DB)
@@users = @@db.collection('system.users')
@ -104,7 +104,7 @@ class DBTest < Test::Unit::TestCase
db.pk_factory = Object.new
fail "error: expected exception"
rescue => ex
assert_match /Cannot change/, ex.to_s
assert_match(/Cannot change/, ex.to_s)
ensure
conn.close
end
@ -280,7 +280,7 @@ class DBTest < Test::Unit::TestCase
assert_not_nil doc
result = doc['result']
assert_not_nil result
assert_match /firstExtent/, result
assert_match(/firstExtent/, result)
end
end