Skip to content
Browse files

Use assert_equal

  • Loading branch information...
1 parent 6d1dfed commit 58201edd8c6912c2e5a8695e32b00562cf574c1b @celeduc celeduc committed
Showing with 6 additions and 6 deletions.
  1. +6 −6 test/test_json.rb
View
12 test/test_json.rb
@@ -29,7 +29,7 @@ def test_json
puts 'jsoned=' + jsoned
unjsoned = JSON.parse jsoned
puts 'unjsoned=' + unjsoned.inspect
- assert unjsoned.name == "whatever"
+ assert_equal unjsoned.name, "whatever"
mm.save
@@ -45,12 +45,12 @@ def test_json
puts 'jsoned=' + jsoned
unjsoned = JSON.parse jsoned
puts 'unjsoned=' + unjsoned.inspect
- assert unjsoned.size == models.size
- assert unjsoned[0].name == mm.name
- assert unjsoned[0].age == mm.age
+ assert_equal unjsoned.size, models.size
+ assert_equal unjsoned[0].name, mm.name
+ assert_equal unjsoned[0].age, mm.age
assert unjsoned[0].created.present?
assert unjsoned[0].id.present?
- assert unjsoned[0].id == mm.id, "unjsoned.id=#{unjsoned[0].id}"
+ assert_equal unjsoned[0].id, mm.id
puts 'array good'
@@ -72,7 +72,7 @@ def test_json
puts 'jsoned=' + jsoned
unjsoned = JSON.parse jsoned
puts 'unjsoned=' + unjsoned.inspect
- assert mcm.my_model.id == unjsoned.my_model.id
+ assert_equal mcm.my_model.id, unjsoned.my_model.id
end

0 comments on commit 58201ed

Please sign in to comment.
Something went wrong with that request. Please try again.