summaryrefslogtreecommitdiff
path: root/test/psych/test_date_time.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-26 21:41:48 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-26 21:41:48 +0000
commit079ff69ca0bb5fc71e2de009829ad7410f374c26 (patch)
tree8015e361386fb00d2257e325b8d0745c9c663b1f /test/psych/test_date_time.rb
parent725d6f4970423c6a28d1b0e1864c3651528d5670 (diff)
* ext/psych/lib/psych/scalar_scanner.rb: fix support for negative
years. * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto * test/psych/test_date_time.rb: test for change. Fixes: https://github.com/tenderlove/psych/issues/168 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/test_date_time.rb')
-rw-r--r--test/psych/test_date_time.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/psych/test_date_time.rb b/test/psych/test_date_time.rb
index 91de6a4841..72150ad7db 100644
--- a/test/psych/test_date_time.rb
+++ b/test/psych/test_date_time.rb
@@ -3,6 +3,15 @@ require 'date'
module Psych
class TestDateTime < TestCase
+ def test_negative_year
+ time = Time.utc -1, 12, 16
+ assert_cycle time
+ end
+
+ def test_new_datetime
+ assert_cycle DateTime.new
+ end
+
def test_invalid_date
assert_cycle "2013-10-31T10:40:07-000000000000033"
end