Sha256: 22872d581f9a5571e2075a797a50b937966fe380ccda4f634c2d327177bd107e

Contents?: true

Size: 929 Bytes

Versions: 6

Compression:

Stored size: 929 Bytes

Contents

require 'spec_helper'
module Alf
  describe Reader do
    
    subject{ Reader }
    it { should respond_to(:rash) }
      
    describe "rash on a real IO" do
      subject{ Reader.rash($stdin) }
      it{ should be_a(Reader::Rash) }
    end
    
    describe "reader" do
      
      specify "when associated" do
        r = Reader.reader('suppliers.rash')
        r.should  be_a(Reader::Rash)
      end
      
      specify "when not associated" do
        lambda{ Reader.reader('.noone') }.should raise_error
      end
      
      specify "when an IO" do
        Reader.reader($stdin).should be_a(Reader::Rash)
      end
      
      specify "when an StringIO" do
        Reader.reader(StringIO.new).should be_a(Reader::Rash)
      end
      
      specify "with options" do
        r = Reader.reader('suppliers.rash', {:hello => "world"})
        r.options.should == {:hello => "world"}
      end
      
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alf-0.12.2 spec/unit/alf-core/test_reader.rb
alf-0.12.1 spec/unit/alf-core/test_reader.rb
alf-0.12.0 spec/unit/alf-core/test_reader.rb
alf-0.11.1 spec/unit/alf-core/test_reader.rb
alf-0.11.0 spec/unit/alf-core/test_reader.rb
alf-0.10.1 spec/unit/test_reader.rb