Skip to content

Commit

Permalink
(#2752) Stub File.readable? for Devuan/Arch Linux
Browse files Browse the repository at this point in the history
This is required to run the test suite on Devuan/Arch Linux boxes.
  • Loading branch information
bastelfreak committed Sep 6, 2024
1 parent 4e912d8 commit 1bf9371
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/framework/detector/os_detector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
before do
RbConfig::CONFIG['host_os'] = 'linux'

# OS detected for Devuan and Arch Linux is special, so we need to explicitly stub it
# See https://github.com/puppetlabs/facter/issues/2752
allow(File).to receive(:readable?).with('/etc/devuan_version').and_return(false)
allow(File).to receive(:readable?).with('/etc/arch-release').and_return(false)
allow(Facter::Resolvers::OsRelease).to receive(:resolve).with(:id)
allow(Facter::Resolvers::RedHatRelease).to receive(:resolve).with(:id).and_return(:redhat)
allow(Facter::Resolvers::SuseRelease).to receive(:resolve).with(:id)
Expand Down

0 comments on commit 1bf9371

Please sign in to comment.