Skip to content

Commit 06e9021

Browse files
committed
Adjust expected directory mode for BSD platforms
Linux's SysV-derived mkdir(2) propagates the set-group-ID bit from the parent directory to newly created subdirectories, but BSD (including macOS) inherits the parent's group without copying the set-group-ID bit itself. The previous 0o2775 expectation therefore failed on every macOS CI runner; branch the expected value by platform instead.
1 parent 9606802 commit 06e9021

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

spec/commands/install_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,13 @@ def run
13321332
bundle :install
13331333
expect(out).to include("Bundle complete!")
13341334
expect(err).to be_empty
1335-
expect(File.stat(foo_path).mode & 0o7777).to eq(0o2775)
1335+
# Linux's SysV-derived mkdir(2) propagates the set-group-ID bit
1336+
# from the parent directory to newly created subdirectories. BSD
1337+
# (including macOS) inherits the parent's group via mkdir(2) but
1338+
# does not copy the set-group-ID bit itself, so the expected
1339+
# mode differs by platform.
1340+
expected = RUBY_PLATFORM.include?("darwin") ? 0o0775 : 0o2775
1341+
expect(File.stat(foo_path).mode & 0o7777).to eq(expected)
13361342
end
13371343
end
13381344
end

0 commit comments

Comments
 (0)