aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/type
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 18:38:23 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 18:38:23 +0200
commit4c208254573c3428d82bd8744860bd86e1c78acb (patch)
tree9c8194acb75552fdda62d527d5c2876da9161650 /activemodel/test/cases/type
parent18a2513729ab90b04b1c86963e7d5b9213270c81 (diff)
downloadrails-4c208254573c3428d82bd8744860bd86e1c78acb.tar.gz
rails-4c208254573c3428d82bd8744860bd86e1c78acb.tar.bz2
rails-4c208254573c3428d82bd8744860bd86e1c78acb.zip
applies new string literal convention in activemodel/test
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'activemodel/test/cases/type')
-rw-r--r--activemodel/test/cases/type/decimal_test.rb6
-rw-r--r--activemodel/test/cases/type/integer_test.rb18
2 files changed, 12 insertions, 12 deletions
diff --git a/activemodel/test/cases/type/decimal_test.rb b/activemodel/test/cases/type/decimal_test.rb
index 1950566c0e..46a913258e 100644
--- a/activemodel/test/cases/type/decimal_test.rb
+++ b/activemodel/test/cases/type/decimal_test.rb
@@ -48,9 +48,9 @@ module ActiveModel
def test_changed?
type = Decimal.new
- assert type.changed?(5.0, 5.0, '5.0wibble')
- assert_not type.changed?(5.0, 5.0, '5.0')
- assert_not type.changed?(-5.0, -5.0, '-5.0')
+ assert type.changed?(5.0, 5.0, "5.0wibble")
+ assert_not type.changed?(5.0, 5.0, "5.0")
+ assert_not type.changed?(-5.0, -5.0, "-5.0")
end
def test_scale_is_applied_before_precision_to_prevent_rounding_errors
diff --git a/activemodel/test/cases/type/integer_test.rb b/activemodel/test/cases/type/integer_test.rb
index 6603f25c9a..0fa7a12de0 100644
--- a/activemodel/test/cases/type/integer_test.rb
+++ b/activemodel/test/cases/type/integer_test.rb
@@ -7,10 +7,10 @@ module ActiveModel
test "simple values" do
type = Type::Integer.new
assert_equal 1, type.cast(1)
- assert_equal 1, type.cast('1')
- assert_equal 1, type.cast('1ignore')
- assert_equal 0, type.cast('bad1')
- assert_equal 0, type.cast('bad')
+ assert_equal 1, type.cast("1")
+ assert_equal 1, type.cast("1ignore")
+ assert_equal 0, type.cast("bad1")
+ assert_equal 0, type.cast("bad")
assert_equal 1, type.cast(1.7)
assert_equal 0, type.cast(false)
assert_equal 1, type.cast(true)
@@ -44,11 +44,11 @@ module ActiveModel
test "changed?" do
type = Type::Integer.new
- assert type.changed?(5, 5, '5wibble')
- assert_not type.changed?(5, 5, '5')
- assert_not type.changed?(5, 5, '5.0')
- assert_not type.changed?(-5, -5, '-5')
- assert_not type.changed?(-5, -5, '-5.0')
+ assert type.changed?(5, 5, "5wibble")
+ assert_not type.changed?(5, 5, "5")
+ assert_not type.changed?(5, 5, "5.0")
+ assert_not type.changed?(-5, -5, "-5")
+ assert_not type.changed?(-5, -5, "-5.0")
assert_not type.changed?(nil, nil, nil)
end