Sha256: 10b1ce72471a8a79974cf68b43d2d3a198c61841650e343824882e31b096a3b7

Contents?: true

Size: 766 Bytes

Versions: 3

Compression:

Stored size: 766 Bytes

Contents

require_relative 'test_helper'

# Unit Test for IOStreams::File
module Streams
  class FileReaderTest < Minitest::Test
    context IOStreams::File::Reader do
      setup do
        @file_name = File.join(File.dirname(__FILE__), 'files', 'text.txt')
        @data      = File.read(@file_name)
      end

      context '.open' do
        should 'file' do
          result = IOStreams::File::Reader.open(@file_name) do |io|
            io.read
          end
          assert_equal @data, result
        end
        should 'stream' do
          result = File.open(@file_name) do |file|
            IOStreams::File::Reader.open(file) do |io|
              io.read
            end
          end
          assert_equal @data, result
        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
iostreams-0.8.1 test/file_reader_test.rb
iostreams-0.8.0 test/file_reader_test.rb
iostreams-0.7.0 test/file_reader_test.rb