Sha256: 01f491b64110f0bb8f56d780dbe691a7ecdcdd2a09464e7d0dd3eb53dc0bf979

Contents?: true

Size: 701 Bytes

Versions: 14

Compression:

Stored size: 701 Bytes

Contents

require_relative 'test_helper'

class FileReaderTest < Minitest::Test
  describe IOStreams::File::Reader do
    let :file_name do
      File.join(File.dirname(__FILE__), 'files', 'text.txt')
    end

    let :raw do
      File.read(file_name)
    end

    describe '.open' do
      it 'file' do
        result = IOStreams::File::Reader.open(file_name) do |io|
          io.read
        end
        assert_equal raw, result
      end

      it 'does not support streams' do
        assert_raises ArgumentError do
          File.open(file_name) do |file|
            IOStreams::File::Reader.open(file) do |io|
              io.read
            end
          end
        end
      end
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
iostreams-0.20.3 test/file_reader_test.rb
iostreams-0.20.2 test/file_reader_test.rb
iostreams-0.20.1 test/file_reader_test.rb
iostreams-0.20.0 test/file_reader_test.rb
iostreams-0.19.0 test/file_reader_test.rb
iostreams-0.18.0 test/file_reader_test.rb
iostreams-0.17.3 test/file_reader_test.rb
iostreams-0.17.2 test/file_reader_test.rb
iostreams-0.17.1 test/file_reader_test.rb
iostreams-0.17.0 test/file_reader_test.rb
iostreams-0.16.2 test/file_reader_test.rb
iostreams-0.16.1 test/file_reader_test.rb
iostreams-0.16.0 test/file_reader_test.rb
iostreams-0.15.0 test/file_reader_test.rb