File: null_encryption_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 (33 lines) | stat: -rw-r--r-- 621 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# frozen_string_literal: true

require_relative '../test_helper'

class NullEncrypterTest < Minitest::Test
  def setup
    @encrypter = ::Zip::NullEncrypter.new
  end

  def test_header_bytesize
    assert_equal 0, @encrypter.header_bytesize
  end

  def test_gp_flags
    assert_equal 0, @encrypter.gp_flags
  end

  def test_header
    assert_empty @encrypter.header(nil)
  end

  def test_encrypt
    assert_nil @encrypter.encrypt(nil)

    ['', 'a' * 10, 0xffffffff].each do |data|
      assert_equal data, @encrypter.encrypt(data)
    end
  end

  def test_reset!
    assert_respond_to @encrypter, :reset!
  end
end