From fcbf63e62c627deae76c1b8cb8c0876c536ed811 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Mon, 16 Mar 2020 18:49:26 +0900 Subject: Fresh start --- jni/ruby/test/psych/handlers/test_recorder.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 jni/ruby/test/psych/handlers/test_recorder.rb (limited to 'jni/ruby/test/psych/handlers') diff --git a/jni/ruby/test/psych/handlers/test_recorder.rb b/jni/ruby/test/psych/handlers/test_recorder.rb new file mode 100644 index 0000000..96b8eac --- /dev/null +++ b/jni/ruby/test/psych/handlers/test_recorder.rb @@ -0,0 +1,25 @@ +require 'psych/helper' +require 'psych/handlers/recorder' + +module Psych + module Handlers + class TestRecorder < TestCase + def test_replay + yaml = "--- foo\n...\n" + output = StringIO.new + + recorder = Psych::Handlers::Recorder.new + parser = Psych::Parser.new recorder + parser.parse yaml + + assert_equal 5, recorder.events.length + + emitter = Psych::Emitter.new output + recorder.events.each do |m, args| + emitter.send m, *args + end + assert_equal yaml, output.string + end + end + end +end -- cgit v1.2.3-70-g09d2