Skip to content

Commit 212d8c6

Browse files
committed
ruby/rubygems#2549 Otherwise the test fails as described in the ported patch.
1 parent 1c72cbf commit 212d8c6

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
From: Jeremy Evans <[email protected]>
2+
Date: Wed, 26 Dec 2018 13:06:19 -0800
3+
Subject: Fix tests when ruby --program-suffix is used without rubygems
4+
--format-executable
5+
6+
Add a test to check for correct behavior when --format-executable
7+
option is used.
8+
---
9+
test/rubygems/test_gem.rb | 10 +++++++++-
10+
1 file changed, 9 insertions(+), 1 deletion(-)
11+
12+
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
13+
index b657874..e740a5a 100644
14+
--- a/test/rubygems/test_gem.rb
15+
+++ b/test/rubygems/test_gem.rb
16+
@@ -150,6 +150,11 @@ def test_self_install_permissions_umask_077
17+
File.umask(umask)
18+
end
19+
20+
+ def test_self_install_permissions_with_format_executable
21+
+ @format_executable = true
22+
+ assert_self_install_permissions
23+
+ end
24+
+
25+
def assert_self_install_permissions
26+
mask = /mingw|mswin/ =~ RUBY_PLATFORM ? 0700 : 0777
27+
options = {
28+
@@ -157,6 +162,7 @@ def assert_self_install_permissions
29+
:prog_mode => 0510,
30+
:data_mode => 0640,
31+
:wrappers => true,
32+
+ :format_executable => !!(@format_executable if defined?(@format_executable))
33+
}
34+
Dir.chdir @tempdir do
35+
Dir.mkdir 'bin'
36+
@@ -182,8 +188,10 @@ def assert_self_install_permissions
37+
prog_mode = (options[:prog_mode] & mask).to_s(8)
38+
dir_mode = (options[:dir_mode] & mask).to_s(8)
39+
data_mode = (options[:data_mode] & mask).to_s(8)
40+
+ prog_name = 'foo.cmd'
41+
+ prog_name = RUBY_INSTALL_NAME.sub('ruby', 'foo.cmd') if options[:format_executable]
42+
expected = {
43+
- "bin/#{RUBY_INSTALL_NAME.sub('ruby', 'foo.cmd')}" => prog_mode,
44+
+ "bin/#{prog_name}" => prog_mode,
45+
'gems/foo-1' => dir_mode,
46+
'gems/foo-1/bin' => dir_mode,
47+
'gems/foo-1/data' => dir_mode,

debian/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
0004-Make-gemspecs-reproducible.patch
55
0005-exclude-several-tests-unstable-in-Docker.patch
66
0006-Port-to-kfreebsd-amd64.patch
7+
0007-Fix-tests-when-ruby-program-suffix-is-used-without-r.patch

0 commit comments

Comments
 (0)