Sha256: 9bd43a92ae6f19f14d9c6a6fb9b66a036f0aac7eecf0744bf3aba606bf12b26e

Contents?: true

Size: 651 Bytes

Versions: 20

Compression:

Stored size: 651 Bytes

Contents

require_relative "test_helper"

class GzipReaderTest < Minitest::Test
  describe IOStreams::Gzip::Reader do
    let :file_name do
      File.join(File.dirname(__FILE__), "files", "text.txt.gz")
    end

    let :decompressed do
      Zlib::GzipReader.open(file_name, &:read)
    end

    describe ".open" do
      it "file" do
        result = IOStreams::Gzip::Reader.file(file_name, &:read)
        assert_equal decompressed, result
      end

      it "stream" do
        result = File.open(file_name) do |file|
          IOStreams::Gzip::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/gzip_reader_test.rb
iostreams-1.10.2 test/gzip_reader_test.rb
iostreams-1.10.1 test/gzip_reader_test.rb
iostreams-1.10.0 test/gzip_reader_test.rb
iostreams-1.9.0 test/gzip_reader_test.rb
iostreams-1.8.0 test/gzip_reader_test.rb
iostreams-1.7.0 test/gzip_reader_test.rb
iostreams-1.6.2 test/gzip_reader_test.rb
iostreams-1.6.1 test/gzip_reader_test.rb
iostreams-1.6.0 test/gzip_reader_test.rb
iostreams-1.5.1 test/gzip_reader_test.rb
iostreams-1.5.0 test/gzip_reader_test.rb
iostreams-1.4.0 test/gzip_reader_test.rb
iostreams-1.3.3 test/gzip_reader_test.rb
iostreams-1.3.2 test/gzip_reader_test.rb
iostreams-1.3.1 test/gzip_reader_test.rb
iostreams-1.3.0 test/gzip_reader_test.rb
iostreams-1.2.1 test/gzip_reader_test.rb
iostreams-1.2.0 test/gzip_reader_test.rb
iostreams-1.1.1 test/gzip_reader_test.rb