From 7b85be1a5dbe64daf8d04fac2880b959e2d089ba Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Mon, 14 Nov 2016 16:28:28 -0500 Subject: [PATCH] Windows symlink detection attempt --- Gemfile | 1 + test/support/tar_test_helpers.rb | 5 +++++ test/test_tar_input.rb | 5 +---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 898283e..90f857a 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/test/support/tar_test_helpers.rb b/test/support/tar_test_helpers.rb index cf1d8d6..8f614c3 100644 --- a/test/support/tar_test_helpers.rb +++ b/test/support/tar_test_helpers.rb @@ -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 diff --git a/test/test_tar_input.rb b/test/test_tar_input.rb index 5e46ffb..b87e040 100644 --- a/test/test_tar_input.rb +++ b/test/test_tar_input.rb @@ -1,9 +1,6 @@ #!/usr/bin/env ruby -require 'minitar' require 'minitest_helper' -require 'base64' -require 'zlib' class TestTarInput < Minitest::Test include TarTester @@ -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')