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 33ba906
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ matrix:
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
rvm: 2.5.3
stage: spec
-
env: FACTER_GEM_VERSION='~> 3.11.0' PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
rvm: 2.5.3
stage: spec
-
env: DEPLOY_TO_FORGE=yes
stage: deploy
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 33ba906

Please sign in to comment.