Sha256: 9a245778d3d95a6ba6bccb4d6411d541be2b85d5fd64509536d29c69eb5eadfb

Contents?: true

Size: 681 Bytes

Versions: 20

Compression:

Stored size: 681 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, &:read)
        assert_equal decompressed, result
      end

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
iostreams-1.10.3 test/bzip2_reader_test.rb
iostreams-1.10.2 test/bzip2_reader_test.rb
iostreams-1.10.1 test/bzip2_reader_test.rb
iostreams-1.10.0 test/bzip2_reader_test.rb
iostreams-1.9.0 test/bzip2_reader_test.rb
iostreams-1.8.0 test/bzip2_reader_test.rb
iostreams-1.7.0 test/bzip2_reader_test.rb
iostreams-1.6.2 test/bzip2_reader_test.rb
iostreams-1.6.1 test/bzip2_reader_test.rb
iostreams-1.6.0 test/bzip2_reader_test.rb
iostreams-1.5.1 test/bzip2_reader_test.rb
iostreams-1.5.0 test/bzip2_reader_test.rb
iostreams-1.4.0 test/bzip2_reader_test.rb
iostreams-1.3.3 test/bzip2_reader_test.rb
iostreams-1.3.2 test/bzip2_reader_test.rb
iostreams-1.3.1 test/bzip2_reader_test.rb
iostreams-1.3.0 test/bzip2_reader_test.rb
iostreams-1.2.1 test/bzip2_reader_test.rb
iostreams-1.2.0 test/bzip2_reader_test.rb
iostreams-1.1.1 test/bzip2_reader_test.rb