diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-28 01:47:58 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-28 01:47:58 +0000 |
commit | f114089585d486920f53c0c4cb92d73dc4ed577c (patch) | |
tree | 6e504795ed0f8049fd18cbe7793487eaf41c0d24 /test/psych/test_stream.rb | |
parent | 13dc8e4ef0c45dc51af820bbca1315edc0b70fb2 (diff) |
Merge Pysch 3.0.3.pre1.
I added the following additional commits from 3.0.3.pre1:
* https://github.com/ruby/psych/pull/356
* https://github.com/ruby/psych/pull/357
* https://github.com/ruby/psych/pull/359
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/test_stream.rb')
-rw-r--r-- | test/psych/test_stream.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/psych/test_stream.rb b/test/psych/test_stream.rb index 3bd557cb68..9b71c6d996 100644 --- a/test/psych/test_stream.rb +++ b/test/psych/test_stream.rb @@ -3,6 +3,22 @@ require_relative 'helper' module Psych class TestStream < TestCase + [ + [Psych::Nodes::Alias, :alias?], + [Psych::Nodes::Document, :document?], + [Psych::Nodes::Mapping, :mapping?], + [Psych::Nodes::Scalar, :scalar?], + [Psych::Nodes::Sequence, :sequence?], + [Psych::Nodes::Stream, :stream?], + ].each do |klass, block| + define_method :"test_predicate_#{block}" do + rb = Psych.parse_stream("---\n- foo: bar\n- &a !!str Anchored\n- *a") + nodes = rb.grep(klass) + assert_operator nodes.length, :>, 0 + assert_equal nodes, rb.find_all(&block) + end + end + def test_parse_partial rb = Psych.parse("--- foo\n...\n--- `").to_ruby assert_equal 'foo', rb |