HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.5.9/spec/ruby/library/yaml/shared/each_document.rb
describe :yaml_each_document, shared: true do
  it "calls the block on each successive document" do
    documents = []
    YAML.send(@method, $multidocument) do |doc|
      documents << doc
    end
    documents.should == [["Mark McGwire", "Sammy Sosa", "Ken Griffey"],
                         ["Chicago Cubs", "St Louis Cardinals"]]
  end

  it "works on files" do
    File.open($test_parse_file, "r") do |file|
      YAML.send(@method, file) do |doc|
        doc.should == {"project"=>{"name"=>"RubySpec"}}
      end
    end
  end
end