summaryrefslogtreecommitdiff
path: root/test/psych
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-10 04:01:30 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-10 04:01:30 +0000
commit7db58f199efc7d31d66ee7b7a7dd272bb0cd9f27 (patch)
tree22597527e33b6f987e393afd716c6e93da75a4d1 /test/psych
parent84bdd5f2c13ba2c30dffb4729b3e6b0207e7a757 (diff)
merges r28532 from trunk into ruby_1_9_2.
-- * ext/psych/lib/psych/visitors/to_ruby.rb(visit_Psych_Nodes_Scalar): teaching Psych to deserialize DateTime objects. [Bug #1390] * ext/psych/lib/psych/visitors/yaml_tree.rb(visit_DateTime): added a method for serializing DateTime objects. * ext/psych/lib/psych/scalar_scanner.rb(parse_time): add method for parsing times objects from a string. * test/psych/test_date_time.rb: tests for dumping DateTime objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych')
-rw-r--r--test/psych/test_date_time.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/psych/test_date_time.rb b/test/psych/test_date_time.rb
new file mode 100644
index 0000000000..df66d142f6
--- /dev/null
+++ b/test/psych/test_date_time.rb
@@ -0,0 +1,17 @@
+require_relative 'helper'
+require 'date'
+
+module Psych
+ class TestDateTime < TestCase
+ def test_string_tag
+ dt = DateTime.now
+ yaml = Psych.dump dt
+ assert_match(/DateTime/, yaml)
+ end
+
+ def test_round_trip
+ dt = DateTime.now
+ assert_cycle dt
+ end
+ end
+end