From efa7a36b3c151bf958b92ebb714a2c98fe4d5ebe Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 5 Oct 2009 16:45:38 -0700 Subject: fixing rational strings --- test/visitors/test_to_ruby.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/visitors') 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 -- cgit v1.2.3