File: bzip2_support_test.rb

package info (click to toggle)
ruby-zip 3.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,120 kB
  • sloc: ruby: 9,958; makefile: 23
file content (18 lines) | stat: -rw-r--r-- 448 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

require_relative 'test_helper'

class Bzip2SupportTest < Minitest::Test
  BZIP2_ZIP_TEST_FILE = 'test/data/zipWithBzip2Compression.zip'

  def test_read
    Zip::InputStream.open(BZIP2_ZIP_TEST_FILE) do |zis|
      error = assert_raises(Zip::CompressionMethodError) do
        zis.get_next_entry
      end

      assert_equal(12, error.compression_method)
      assert_match(/BZIP2/, error.message)
    end
  end
end