Skip to content
Browse files

Fix wrong assertion: use assert_equal.

From Ruby r27587 and r27590, by nobu.
  • Loading branch information...
1 parent d496f79 commit 9b781e65f8231ae0db33eeccda27abab385d98ce @nurse nurse committed with flori May 2, 2010
Showing with 6 additions and 6 deletions.
  1. +6 −6 tests/test_json_addition.rb
View
12 tests/test_json_addition.rb
@@ -151,12 +151,12 @@ def test_core
def test_utc_datetime
now = Time.now
d = DateTime.parse(now.to_s) # usual case
- assert d, JSON.parse(d.to_json)
+ assert_equal d, JSON.parse(d.to_json)
d = DateTime.parse(now.utc.to_s) # of = 0
- assert d, JSON.parse(d.to_json)
- d = DateTime.civil(2008, 6, 17, 11, 48, 32, 1) # of = 1 / 12 => 1/12
- assert d, JSON.parse(d.to_json)
- d = DateTime.civil(2008, 6, 17, 11, 48, 32, 12) # of = 12 / 12 => 12
- assert d, JSON.parse(d.to_json)
+ assert_equal d, JSON.parse(d.to_json)
+ d = DateTime.civil(2008, 6, 17, 11, 48, 32, Rational(1,24))
+ assert_equal d, JSON.parse(d.to_json)
+ d = DateTime.civil(2008, 6, 17, 11, 48, 32, Rational(12,24))
+ assert_equal d, JSON.parse(d.to_json)
end
end

0 comments on commit 9b781e6

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