Skip to content

Commit

Permalink
Clean up file permissions tests.
Browse files Browse the repository at this point in the history
Now we don't differentiate between Windows and Linux in the library code for
this, we don't need separate tests.
  • Loading branch information
hainesr committed Sep 1, 2016
1 parent 7b14d11 commit b005c48
Showing 1 changed file with 16 additions and 31 deletions.
47 changes: 16 additions & 31 deletions test/file_permissions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,33 @@ def teardown
::File.unlink(FILENAME)
end

if ::Zip::RUNNING_ON_WINDOWS
# Windows tests

DEFAULT_PERMS = 0644
def test_current_umask
create_files
assert_matching_permissions FILENAME, ZIPNAME
end

def test_windows_perms
def test_umask_000
set_umask(0000) do
create_files
assert_matching_permissions FILENAME, ZIPNAME
end

else
# Unix tests
assert_matching_permissions FILENAME, ZIPNAME
end

def test_current_umask
def test_umask_066
set_umask(0066) do
create_files
assert_matching_permissions FILENAME, ZIPNAME
end

def test_umask_000
set_umask(0000) do
create_files
end

assert_matching_permissions FILENAME, ZIPNAME
end

def test_umask_066
set_umask(0066) do
create_files
end

assert_matching_permissions FILENAME, ZIPNAME
end

def test_umask_027
set_umask(0027) do
create_files
end
assert_matching_permissions FILENAME, ZIPNAME
end

assert_matching_permissions FILENAME, ZIPNAME
def test_umask_027
set_umask(0027) do
create_files
end

assert_matching_permissions FILENAME, ZIPNAME
end

def assert_matching_permissions(expected_file, actual_file)
Expand Down

0 comments on commit b005c48

Please sign in to comment.