Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/facter/iptables_persistent_version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

Facter.add(:iptables_persistent_version) do
confine operatingsystem: ['Debian', 'Ubuntu']
confine 'os.name': ['Debian', 'Ubuntu']
setcode do
# Throw away STDERR because dpkg >= 1.16.7 will make some noise if the
# package isn't currently installed.
Expand Down
20 changes: 10 additions & 10 deletions spec/unit/facter/iptables_persistent_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

describe "#{os} package installed" do
before(:each) do
allow(Facter.fact(:operatingsystem)).to receive(:value).and_return(os)
allow(Facter.fact(:operatingsystemrelease)).to receive(:value).and_return(os_release)
allow(Facter.fact(:'os.name')).to receive(:value).and_return(os)
allow(Facter.fact(:'os.release.full')).to receive(:value).and_return(os_release)
allow(Facter::Core::Execution).to receive(:execute).with(dpkg_cmd, { on_fail: nil })
.and_return(ver)
end
Expand All @@ -27,8 +27,8 @@

describe 'Ubuntu package not installed' do
before(:each) do
allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('Ubuntu')
allow(Facter.fact(:operatingsystemrelease)).to receive(:value).and_return('20.04')
allow(Facter.fact(:'os.name')).to receive(:value).and_return('Ubuntu')
allow(Facter.fact(:'os.release.full')).to receive(:value).and_return('20.04')
allow(Facter::Core::Execution).to receive(:execute).with(dpkg_cmd, { on_fail: nil })
.and_return(nil)
end
Expand All @@ -38,7 +38,7 @@

describe 'CentOS not supported' do
before(:each) do
allow(Facter.fact(:operatingsystem)).to receive(:value)
allow(Facter.fact(:'os.name')).to receive(:value)
.and_return('CentOS')
end

Expand All @@ -63,8 +63,8 @@

describe "#{os} package installed" do
before(:each) do
allow(Facter.fact(:operatingsystem)).to receive(:value).and_return(os)
allow(Facter.fact(:operatingsystemrelease)).to receive(:value).and_return(os_release)
allow(Facter.fact(:'os.name')).to receive(:value).and_return(os)
allow(Facter.fact(:'os.release.full')).to receive(:value).and_return(os_release)
allow(Facter::Core::Execution).to receive(:execute).with(dpkg_cmd, { on_fail: nil })
.and_return(ver)
end
Expand All @@ -76,8 +76,8 @@
describe 'Ubuntu package not installed' do
os_release = '14.10'
before(:each) do
allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('Ubuntu')
allow(Facter.fact(:operatingsystemrelease)).to receive(:value).and_return(os_release)
allow(Facter.fact(:'os.name')).to receive(:value).and_return('Ubuntu')
allow(Facter.fact(:'os.release.full')).to receive(:value).and_return(os_release)
allow(Facter::Core::Execution).to receive(:execute).with(dpkg_cmd, { on_fail: nil })
.and_return(nil)
end
Expand All @@ -87,7 +87,7 @@

describe 'CentOS not supported' do
before(:each) do
allow(Facter.fact(:operatingsystem)).to receive(:value)
allow(Facter.fact(:'os.name')).to receive(:value)
.and_return('CentOS')
end

Expand Down
Loading