Class: PassThruCompressorTest

Inherits:
MiniTest::Test
  • Object
show all
Includes:
CrcTest
Defined in:
lib/hotplate/gems/rubyzip-1.1.7/test/pass_thru_compressor_test.rb

Instance Method Summary collapse

Methods included from CrcTest

#run_crc_test

Instance Method Details

#test_crcObject



28
29
30
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/pass_thru_compressor_test.rb', line 28

def test_crc
  run_crc_test(::Zip::PassThruCompressor)
end

#test_sizeObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/pass_thru_compressor_test.rb', line 6

def test_size
  File.open("test/data/generated/dummy.txt", "wb") {
      |file|
    compressor = ::Zip::PassThruCompressor.new(file)

    assert_equal(0, compressor.size)

    t1 = "hello world"
    t2 = ""
    t3 = "bingo"

    compressor << t1
    assert_equal(compressor.size, t1.size)

    compressor << t2
    assert_equal(compressor.size, t1.size + t2.size)

    compressor << t3
    assert_equal(compressor.size, t1.size + t2.size + t3.size)
  }
end