summaryrefslogtreecommitdiff
path: root/test/visitors/test_to_ruby.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2009-10-06 16:42:39 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2009-10-06 16:42:39 -0700
commit4d48bff3590440b1bc35daf511efb216258b87d0 (patch)
tree52b854d771b70f80b929d34cefa34ca72c543276 /test/visitors/test_to_ruby.rb
parentefa7a36b3c151bf958b92ebb714a2c98fe4d5ebe (diff)
downloadpsych-4d48bff3590440b1bc35daf511efb216258b87d0.zip
string ranges supported
Diffstat (limited to 'test/visitors/test_to_ruby.rb')
-rw-r--r--test/visitors/test_to_ruby.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/visitors/test_to_ruby.rb b/test/visitors/test_to_ruby.rb
index 63a5006..c60a9b9 100644
--- a/test/visitors/test_to_ruby.rb
+++ b/test/visitors/test_to_ruby.rb
@@ -52,6 +52,16 @@ module Psych
end
end
+ def test_range_string
+ node = Nodes::Scalar.new '1..2', nil, "!ruby/range"
+ assert_equal 1..2, node.to_ruby
+ end
+
+ def test_range_string_triple
+ node = Nodes::Scalar.new '1...3', nil, "!ruby/range"
+ assert_equal 1...3, node.to_ruby
+ end
+
def test_integer
i = Nodes::Scalar.new('1', nil, 'tag:yaml.org,2002:int')
assert_equal 1, i.to_ruby