diff options
author | Sean Griffin <sean@thoughtbot.com> | 2015-01-01 11:24:29 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2015-01-01 11:24:29 -0700 |
commit | 8b07f18599854475a69c1447642dd3d80bea8df9 (patch) | |
tree | f6c057bfa075fac36c111f88500b6a721c2b5fef /activerecord/test | |
parent | 667b3ef873f5574d69d58f94de288d80615e3660 (diff) | |
download | rails-8b07f18599854475a69c1447642dd3d80bea8df9.tar.gz rails-8b07f18599854475a69c1447642dd3d80bea8df9.tar.bz2 rails-8b07f18599854475a69c1447642dd3d80bea8df9.zip |
Stop explicitly passing `nil` as the column to `type_cast`
So we can change the arity later.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/sqlite3/quoting_test.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb index dd10995a1d..df497e761c 100644 --- a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb @@ -21,46 +21,46 @@ module ActiveRecord end def test_type_cast_symbol - assert_equal 'foo', @conn.type_cast(:foo, nil) + assert_equal 'foo', @conn.type_cast(:foo) end def test_type_cast_date date = Date.today expected = @conn.quoted_date(date) - assert_equal expected, @conn.type_cast(date, nil) + assert_equal expected, @conn.type_cast(date) end def test_type_cast_time time = Time.now expected = @conn.quoted_date(time) - assert_equal expected, @conn.type_cast(time, nil) + assert_equal expected, @conn.type_cast(time) end def test_type_cast_numeric - assert_equal 10, @conn.type_cast(10, nil) - assert_equal 2.2, @conn.type_cast(2.2, nil) + assert_equal 10, @conn.type_cast(10) + assert_equal 2.2, @conn.type_cast(2.2) end def test_type_cast_nil - assert_equal nil, @conn.type_cast(nil, nil) + assert_equal nil, @conn.type_cast(nil) end def test_type_cast_true - assert_equal 't', @conn.type_cast(true, nil) + assert_equal 't', @conn.type_cast(true) end def test_type_cast_false - assert_equal 'f', @conn.type_cast(false, nil) + assert_equal 'f', @conn.type_cast(false) end def test_type_cast_bigdecimal bd = BigDecimal.new '10.0' - assert_equal bd.to_f, @conn.type_cast(bd, nil) + assert_equal bd.to_f, @conn.type_cast(bd) end def test_type_cast_unknown_should_raise_error obj = Class.new.new - assert_raise(TypeError) { @conn.type_cast(obj, nil) } + assert_raise(TypeError) { @conn.type_cast(obj) } end def test_type_cast_object_which_responds_to_quoted_id @@ -73,14 +73,14 @@ module ActiveRecord 10 end }.new - assert_equal 10, @conn.type_cast(quoted_id_obj, nil) + assert_equal 10, @conn.type_cast(quoted_id_obj) quoted_id_obj = Class.new { def quoted_id "'zomg'" end }.new - assert_raise(TypeError) { @conn.type_cast(quoted_id_obj, nil) } + assert_raise(TypeError) { @conn.type_cast(quoted_id_obj) } end def test_quoting_binary_strings |