Sha256: 9925cd4f91dde34aa43cd5aa5106f9e2aee5c5f617ec1852cdc0f86a5840f1b8

Contents?: true

Size: 470 Bytes

Versions: 5

Compression:

Stored size: 470 Bytes

Contents

require 'spec_helper'
module Alf
  describe Reader, "looks_a_path?" do

    it 'should recognize strings' do
      Reader.send(:looks_a_path?, "path/to/a/file.rash").should be_true
    end

    it 'should recognize XXX#path' do
      obj = Object.new
      def obj.to_path; end
      Reader.send(:looks_a_path?, obj).should be_true
    end

    it 'should not recognize StringIO' do
      Reader.send(:looks_a_path?, StringIO.new("")).should be_false
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alf-0.12.2 spec/unit/alf-core/reader/test_looks_a_path.rb
alf-0.12.1 spec/unit/alf-core/reader/test_looks_a_path.rb
alf-0.12.0 spec/unit/alf-core/reader/test_looks_a_path.rb
alf-0.11.1 spec/unit/alf-core/reader/test_looks_a_path.rb
alf-0.11.0 spec/unit/alf-core/reader/test_looks_a_path.rb