Sha256: 67f040697e9ee1896963713bba28f73979cfabd302672b72b2e90f72a87388c2

Contents?: true

Size: 1.42 KB

Versions: 26

Compression:

Stored size: 1.42 KB

Contents

require 'test_helper'
require 'zip/filesystem'

class ZipFsFileStatTest < MiniTest::Test
  def setup
    @zip_file = ::Zip::File.new('test/data/zipWithDirs.zip')
  end

  def teardown
    @zip_file.close if @zip_file
  end

  def test_blocks
    assert_nil(@zip_file.file.stat('file1').blocks)
  end

  def test_ino
    assert_equal(0, @zip_file.file.stat('file1').ino)
  end

  def test_uid
    assert_equal(0, @zip_file.file.stat('file1').uid)
  end

  def test_gid
    assert_equal(0, @zip_file.file.stat('file1').gid)
  end

  def test_ftype
    assert_equal('file', @zip_file.file.stat('file1').ftype)
    assert_equal('directory', @zip_file.file.stat('dir1').ftype)
  end

  def test_mode
    assert_equal(0600, @zip_file.file.stat('file1').mode & 0777)
    assert_equal(0600, @zip_file.file.stat('file1').mode & 0777)
    assert_equal(0755, @zip_file.file.stat('dir1').mode & 0777)
    assert_equal(0755, @zip_file.file.stat('dir1').mode & 0777)
  end

  def test_dev
    assert_equal(0, @zip_file.file.stat('file1').dev)
  end

  def test_rdev
    assert_equal(0, @zip_file.file.stat('file1').rdev)
  end

  def test_rdev_major
    assert_equal(0, @zip_file.file.stat('file1').rdev_major)
  end

  def test_rdev_minor
    assert_equal(0, @zip_file.file.stat('file1').rdev_minor)
  end

  def test_nlink
    assert_equal(1, @zip_file.file.stat('file1').nlink)
  end

  def test_blksize
    assert_nil(@zip_file.file.stat('file1').blksize)
  end
end

Version data entries

26 entries across 20 versions & 4 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
tdiary-5.0.11 vendor/bundle/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
vagrant-unbundled-2.1.2.0 vendor/bundle/ruby/2.3.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
tdiary-5.0.9 vendor/bundle/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
vagrant-unbundled-2.1.1.0 vendor/bundle/ruby/2.5.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
vagrant-unbundled-2.0.4.0 vendor/bundle/ruby/2.5.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
tdiary-5.0.8 vendor/bundle/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
vagrant-unbundled-2.0.3.0 vendor/bundle/ruby/2.5.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.4.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.5.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
tdiary-5.0.7 vendor/bundle/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
vagrant-unbundled-2.0.1.0 vendor/bundle/ruby/2.4.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
tdiary-5.0.6 vendor/bundle/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
vagrant-unbundled-2.0.0.1 vendor/bundle/ruby/2.4.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb
vagrant-unbundled-1.9.8.1 vendor/bundle/ruby/2.4.0/gems/rubyzip-1.2.1/test/filesystem/file_stat_test.rb