diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2009-10-07 09:32:58 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2009-10-07 09:32:58 -0700 |
commit | 762d889dc911c43274aa4c00104302d36e883add (patch) | |
tree | 9afd10778aea5ac53001a569d22d7452d7e5709d /test/visitors/test_to_ruby.rb | |
parent | 2cf1f822b5e44308bb9e5af8ee4d75cfda0b4d9e (diff) | |
download | psych-762d889dc911c43274aa4c00104302d36e883add.zip |
scalar regexp goes to ruby
Diffstat (limited to 'test/visitors/test_to_ruby.rb')
-rw-r--r-- | test/visitors/test_to_ruby.rb | 11 |
1 files changed, 11 insertions, 0 deletions
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") + |