Skip to content

Commit

Permalink
Windows symlink detection attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
halostatue committed Nov 14, 2016
1 parent e25205e commit 7b85be1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ mime_version =
end

gem 'mime-types', "~> #{mime_version}"
gem 'win32-file', '~> 0.8', platforms: [ :mswin, :mingw, :x64_mingw ]

gemspec :name => 'minitar'

Expand Down
5 changes: 5 additions & 0 deletions test/support/tar_test_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# frozen_string_literal: true

require 'minitar'
require 'win32/file' if Archive::Tar::Minitar.windows?
require 'base64'
require 'zlib'

module TarTestHelpers
private

Expand Down
5 changes: 1 addition & 4 deletions test/test_tar_input.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/usr/bin/env ruby

require 'minitar'
require 'minitest_helper'
require 'base64'
require 'zlib'

class TestTarInput < Minitest::Test
include TarTester
Expand Down Expand Up @@ -134,7 +131,7 @@ def test_extract_entry_works
end

def test_extract_entry_breaks_symlinks
return if Minitar.windows?
return if Minitar.windows? && !defined?(Windows::File::Functions)

IO.write('data__/file4', '')
File.symlink('data__/file4', 'data__/file3')
Expand Down

0 comments on commit 7b85be1

Please # to comment.