Sha256: c99f377fc53167c1b9326af9eb62e301073797e9709b11183c2c879d6f3d034c

Contents?: true

Size: 744 Bytes

Versions: 14

Compression:

Stored size: 744 Bytes

Contents

require_relative 'test_helper'

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

    let :decompressed do
      File.read(File.join(File.dirname(__FILE__), 'files', 'text.txt'))
    end

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

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

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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