summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2009-10-05 16:45:38 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2009-10-05 16:45:38 -0700
commitefa7a36b3c151bf958b92ebb714a2c98fe4d5ebe (patch)
treeb77e5647bc0a20e9085d560f95082f1dee20c308 /test
parenta5aa707138e05d42b7448c1ab2e229ac887506e5 (diff)
downloadpsych-efa7a36b3c151bf958b92ebb714a2c98fe4d5ebe.zip
fixing rational strings
Diffstat (limited to 'test')
-rw-r--r--test/visitors/test_to_ruby.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/visitors/test_to_ruby.rb b/test/visitors/test_to_ruby.rb
index 3cb1ead..63a5006 100644
--- a/test/visitors/test_to_ruby.rb
+++ b/test/visitors/test_to_ruby.rb
@@ -45,6 +45,11 @@ module Psych
node = Nodes::Scalar.new '3+4i', nil, "!ruby/object:Complex"
assert_equal Complex(3, 4), node.to_ruby
end
+
+ def test_rational_string
+ node = Nodes::Scalar.new '1/2', nil, "!ruby/object:Rational"
+ assert_equal Rational(1, 2), node.to_ruby
+ end
end
def test_integer