Skip to content

Commit 4929232

Browse files
committed
windows testing
Signed-off-by: Austin Ziegler <austin@zieglers.ca>
1 parent 023d7a8 commit 4929232

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ source "https://rubygems.org/"
66

77
group :development do
88
gem "solargraph", platform: :mri
9+
gem "fiddle", platform: :windows
910
end
1011

1112
gemspec

minitar.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
99
s.metadata = { "bug_tracker_uri" => "https://github.com/halostatue/minitar/issues", "changelog_uri" => "https://github.com/halostatue/minitar/blob/main/CHANGELOG.md", "rubygems_mfa_required" => "true", "source_code_uri" => "https://github.com/halostatue/minitar" } if s.respond_to? :metadata=
1010
s.require_paths = ["lib".freeze]
1111
s.authors = ["Austin Ziegler".freeze]
12-
s.date = "2025-09-03"
12+
s.date = "2025-09-07"
1313
s.description = "The minitar library is a pure-Ruby library that operates on POSIX tar(1) archive files. minitar (previously called Archive::Tar::Minitar) is based heavily on code originally written by Mauricio Julio Fern\u00E1ndez Pradier for the rpa-base project.".freeze
1414
s.email = ["halostatue@gmail.com".freeze]
1515
s.extra_rdoc_files = ["CHANGELOG.md".freeze, "CODE_OF_CONDUCT.md".freeze, "CONTRIBUTING.md".freeze, "CONTRIBUTORS.md".freeze, "LICENCE.md".freeze, "Manifest.txt".freeze, "README.md".freeze, "SECURITY.md".freeze, "docs/bsdl.txt".freeze, "docs/ruby.txt".freeze, "licenses/bsdl.txt".freeze, "licenses/dco.txt".freeze, "licenses/ruby.txt".freeze]

test/support/minitar_test_helpers/tarball.rb

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@
66
module Minitar::TestHelpers::Tarball
77
private
88

9-
tar_version = `tar --version`
10-
11-
GNU_TAR =
12-
case tar_version
13-
when /\(GNU tar\)|Free Software Foundation/
14-
`which tar`.chomp
15-
when /bsdtar/
16-
`which gtar`.chomp
17-
end.freeze
9+
GNU_TAR = %w[tar gtar].find { |program|
10+
path = `bash -c "command -v 'which #{program}'"`.chomp
11+
12+
if path.empty?
13+
false
14+
else
15+
version = `#{program} --version`.chomp
16+
version =~ /\(GNU tar\)|Free Software Foundation/
17+
end
18+
}.freeze
1819

1920
# Given the +original_files+ file hash (input to +create_tar_string+) and the
2021
# +extracted_files+ file has (output from +extract_tar_string+), ensures that the tar
@@ -128,9 +129,13 @@ def prepare_workspace(with_files:)
128129

129130
if _2.nil?
130131
full_path.mkpath
132+
133+
assert full_path.directory?, "#{full_path} should be created as a directory"
131134
else
132135
full_path.dirname.mkpath
133136
full_path.write(_2)
137+
138+
assert full_path.file?, "#{full_path} should be created as a file"
134139
end
135140
end
136141
end

test/test_gnu_tar_compatibility.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def test_gnu_tar_list_compatibility_with_long_filenames
8181

8282
list_output = gnu_tar_list_in_workspace
8383
files.each_key do |name|
84-
assert list_output.find { _1 == name }, "#{name} not present in GNU tar list output"
84+
assert list_output.find { _1 == name },
85+
"#{name} not present in GNU tar list output: #{list_output}"
8586
end
8687

8788
gnu_tar_extract_in_workspace

0 commit comments

Comments
 (0)