Skip to content

Commit

Permalink
MODULES-10915: use facter 3 for spec test
Browse files Browse the repository at this point in the history
This likely needs fixing in pdk or .sync but wanted to at least test the
fix first
  • Loading branch information
b4ldr committed Jan 11, 2021
1 parent cada6d4 commit 9e01df4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ matrix:
rvm: 2.4.5
stage: spec
-
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
env: FACTER_GEM_VERSION='~> 3.11.0' PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
rvm: 2.5.3
stage: spec
-
Expand Down
4 changes: 3 additions & 1 deletion lib/facter/lvm_support.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# lvm_support: true/nil
# Whether there is LVM support (based on the presence of the "vgs" command)
Facter.add('lvm_support') do
confine kernel: :linux
confine do
Facter.value('kernel') == 'Linux'
end

setcode do
vgdisplay = Facter::Util::Resolution.which('vgs')
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/facter/lvm_support_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
end

context 'when not on Linux' do
it 'is set to not' do
it 'is set to nil' do
Facter.fact(:kernel).expects(:value).at_least(1).returns('SunOs')
Facter.value(:lvm_support).should be_nil
end
Expand Down

0 comments on commit 9e01df4

Please sign in to comment.