Merge pull request #16303 from Bo98/test-fixes

test: fix a couple failures on certain systems
This commit is contained in:
Mike McQuaid 2023-12-07 15:34:49 -05:00 committed by GitHub
commit cd6f3fe56d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -284,6 +284,7 @@ describe Caveats do
let(:caveats) { described_class.new(f).caveats }
it "adds the correct amount of new lines to the output" do
expect(Utils::Service).to receive(:launchctl?).at_least(:once).and_return(true)
expect(caveats).to include("something else")
expect(caveats).to include("keg-only")
expect(caveats).to include("if you don't want/need a background service")

View File

@ -65,7 +65,8 @@ describe UnpackStrategy do
it "does not make other files writable" do
strategy.extract_nestedly(to: unpack_dir)
expect(unpack_dir/executable).not_to be_writable
# We don't check `writable?` here as that's always true as root.
expect((unpack_dir/executable).stat.mode & 0222).to be_zero
end
end
end