Sha256: f0c3bb9c36c9ec0113630932c3de2660af7724a1129cd717159449de86af90a8

Contents?: true

Size: 746 Bytes

Versions: 9

Compression:

Stored size: 746 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 '.file' do
      it 'file' do
        result = IOStreams::Bzip2::Reader.file(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.stream(file) do |io|
            io.read
          end
        end
        assert_equal decompressed, result
      end
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
iostreams-1.1.0 test/bzip2_reader_test.rb
iostreams-1.0.0 test/bzip2_reader_test.rb
iostreams-1.0.0.beta7 test/bzip2_reader_test.rb
iostreams-1.0.0.beta6 test/bzip2_reader_test.rb
iostreams-1.0.0.beta5 test/bzip2_reader_test.rb
iostreams-1.0.0.beta4 test/bzip2_reader_test.rb
iostreams-1.0.0.beta3 test/bzip2_reader_test.rb
iostreams-1.0.0.beta2 test/bzip2_reader_test.rb
iostreams-1.0.0.beta test/bzip2_reader_test.rb