From 762d889dc911c43274aa4c00104302d36e883add Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 7 Oct 2009 09:32:58 -0700 Subject: scalar regexp goes to ruby --- test/visitors/test_to_ruby.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/visitors/test_to_ruby.rb b/test/visitors/test_to_ruby.rb index 41eae48..7fd99a4 100644 --- a/test/visitors/test_to_ruby.rb +++ b/test/visitors/test_to_ruby.rb @@ -11,6 +11,17 @@ module Psych @visitor = ToRuby.new end + def test_regexp + node = Nodes::Scalar.new('/foo/', nil, '!ruby/regexp') + assert_equal(/foo/, node.to_ruby) + + node = Nodes::Scalar.new('/foo/m', nil, '!ruby/regexp') + assert_equal(/foo/m, node.to_ruby) + + node = Nodes::Scalar.new('/foo/ix', nil, '!ruby/regexp') + assert_equal(/foo/ix, node.to_ruby) + end + def test_time now = Time.now formatted = now.strftime("%Y-%m-%d %H:%M:%S") + -- cgit v1.2.3