From 4ea7a1460851b4b0eb956df2cfc9b17f2d48b023 Mon Sep 17 00:00:00 2001 From: Wojciech Piekutowski Date: Sun, 20 Feb 2011 17:19:14 +0100 Subject: [PATCH] Add parenthesis where Ruby thinks they're a good idea --- test/connection_test.rb | 2 +- test/conversions_test.rb | 20 ++++++++++---------- test/cursor_test.rb | 2 +- test/db_test.rb | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/connection_test.rb b/test/connection_test.rb index d66332b..f1962e6 100644 --- a/test/connection_test.rb +++ b/test/connection_test.rb @@ -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 diff --git a/test/conversions_test.rb b/test/conversions_test.rb index c001826..a3545bc 100644 --- a/test/conversions_test.rb +++ b/test/conversions_test.rb @@ -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 diff --git a/test/cursor_test.rb b/test/cursor_test.rb index a91f964..4b974b1 100644 --- a/test/cursor_test.rb +++ b/test/cursor_test.rb @@ -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 diff --git a/test/db_test.rb b/test/db_test.rb index b4850fd..0a53759 100644 --- a/test/db_test.rb +++ b/test/db_test.rb @@ -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