Sha256: 1781a50f5d7ce099da1e092673b5f821289c43c08c7f31665aee27225e218e1a

Contents?: true

Size: 758 Bytes

Versions: 12

Compression:

Stored size: 758 Bytes

Contents

require_relative 'test_helper'
require 'zip'

class ZipReaderTest < Minitest::Test
  describe IOStreams::Zip::Reader do
    let :file_name do
      File.join(File.dirname(__FILE__), 'files', 'text.zip')
    end

    let :decompressed do
      Zip::File.open(file_name) { |zip_file| zip_file.first.get_input_stream.read }
    end

    describe '.open' do
      it 'file' do
        result = IOStreams::Zip::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::Zip::Reader.open(file) do |io|
            io.read
          end
        end
        assert_equal decompressed, result
      end
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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