Class: ZipFsFileStatTest

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

Instance Method Summary collapse

Instance Method Details

#setupObject



6
7
8
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 6

def setup
  @zip_file = ::Zip::File.new("test/data/zipWithDirs.zip")
end

#teardownObject



10
11
12
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 10

def teardown
  @zip_file.close if @zip_file
end

#test_blksizeObject



62
63
64
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 62

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

#test_blocksObject



14
15
16
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 14

def test_blocks
  assert_equal(nil, @zip_file.file.stat("file1").blocks)
end

#test_devObject



42
43
44
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 42

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

#test_ftypeObject



30
31
32
33
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 30

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

#test_gidObject



26
27
28
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 26

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

#test_inoObject



18
19
20
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 18

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

#test_modeObject



35
36
37
38
39
40
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 35

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


58
59
60
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 58

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

#test_rdevObject



46
47
48
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 46

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

#test_rdev_majorObject



50
51
52
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 50

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

#test_rdev_minorObject



54
55
56
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 54

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

#test_uidObject



22
23
24
# File 'lib/hotplate/gems/rubyzip-1.1.7/test/filesystem/file_stat_test.rb', line 22

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