Sha256: cf14a1646702262be3aab294398b930992717aa9d5a340774e88ef1125a288c5

Contents?: true

Size: 631 Bytes

Versions: 1

Compression:

Stored size: 631 Bytes

Contents

require 'spec_helper'
require 'json'
module Alf
  describe Reader::YAML do
    it_should_behave_like "a Reader class"

    let(:str)   { input.to_yaml        }
    let(:io)    { StringIO.new(str)    }
    let(:reader){ Reader::YAML.new(io) }

    subject{ reader.to_a }

    describe "when called on a Array" do
      let(:input){ [{:id => 1},{:id => 2}] }

      it "read the lines as expected" do
        subject.should eq(input)
      end
    end

    describe "when called on a Hash" do
      let(:input){ {:id => 1} }

      it "should yield the single Hash" do
        subject.should eq([input])
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-io/reader/test_yaml.rb