Sha256: cd9f091e86bf06a09c77ee43e9f97e6898e1895a13109c20c5650e491f4a24a7

Contents?: true

Size: 595 Bytes

Versions: 6

Compression:

Stored size: 595 Bytes

Contents

require 'spec_helper'
module Sexpr
  describe Parser, "input_text" do
    include Parser

    it 'recognizes a string' do
      input_text("Hello world").should eq("Hello world")
    end

    it 'accepts a path' do
      input_text(Path.here).should eq(File.read(__FILE__))
    end

    it 'accepts an IO' do
      File.open(__FILE__, 'r') do |io|
        input_text(io).should eq(File.read(__FILE__))
      end
    end

    it 'raises a InvalidParseSourceError when invalid source' do
      lambda{
        input_text(self)
      }.should raise_error(InvalidParseSourceError)
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sexpr-1.0.0 spec/unit/parser/test_input_text.rb
sexpr-0.6.0 spec/unit/parser/test_input_text.rb
sexpr-0.5.1 spec/parser/test_input_text.rb
sexpr-0.5.0 spec/parser/test_input_text.rb
sexpr-0.4.0 spec/parser/test_input_text.rb
sexpr-0.3.0 spec/parser/test_input_text.rb