Sha256: 6a3a2cbb9d5491004c0b9eafc605866dbc4c65fdfafaa998b2a74955b3d2b398

Contents?: true

Size: 718 Bytes

Versions: 2

Compression:

Stored size: 718 Bytes

Contents

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

    let(:lines){ [{:id => 1},{:id => 2}]                 }
    let(:str)  { lines.collect{|s| s.inspect}.join("\n") }
    let(:io)   { StringIO.new(str) }

    describe "when called on a StringIO" do
      
      let(:reader){ Reader::Rash.new(io) }
  
      it "should be enumerable" do
        reader.to_a.should == lines
      end

    end
    
    describe "when called on a String" do
      
      let(:file){ File.expand_path('../input.rash', __FILE__) }
      let(:reader){ Reader::Rash.new(file) }
  
      it "should be enumerable" do
        reader.to_a.should == lines
      end

    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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