Sha256: 7b6428b526145a11511dce699cd8c52feaa542547aede43580efc655aac3b278

Contents?: true

Size: 973 Bytes

Versions: 13

Compression:

Stored size: 973 Bytes

Contents

# -*- coding: utf-8 -*-
#
# @file 
# @brief
# @author ongaeshi
# @date   2011/02/20

require 'milkode/common/util'
require 'test/unit'
require 'file_test_utils'

class TestUtil < Test::Unit::TestCase
  include FileTestUtils

  def test_zip_extract
    Milkode::Util::zip_extract('../data/abc.zip', '.')
    assert File.exist?('abc')
    assert File.exist?('abc/a.txt')
    assert File.exist?('abc/b.txt')
    assert File.exist?('abc/c.txt')
    
    Milkode::Util::zip_extract('../data/nodir_abc.zip', '.')
    assert File.exist?('nodir_abc')
    assert File.exist?('nodir_abc/a.txt')
    assert File.exist?('nodir_abc/b.txt')
    assert File.exist?('nodir_abc/c.txt')
  end

  def test_root_entrylist
    assert_equal ['abc/'], Milkode::Util::root_entrylist('../data/abc.zip')
    assert_equal ['a.txt', 'b.txt', 'c.txt'], Milkode::Util::root_entrylist('../data/nodir_abc.zip')
  end
  
  def teardown
    teardown_custom(true)
    #    teardown_custom(false)
  end
end


Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
milkode-0.2.2 test/test_util.rb
milkode-0.2.1 test/test_util.rb
milkode-0.2.0 test/test_util.rb
milkode-0.1.9 test/test_util.rb
milkode-0.1.8 test/test_util.rb
milkode-0.1.7 test/test_util.rb
milkode-0.1.6 test/test_util.rb
milkode-0.1.5 test/test_util.rb
milkode-0.1.4 test/test_util.rb
milkode-0.1.3 test/test_util.rb
milkode-0.1.2 test/test_util.rb
milkode-0.1.1 test/test_util.rb
milkode-0.1.0 test/test_util.rb