From 33ba906c0ae2ee07c2dd530ec381970ab5237d91 Mon Sep 17 00:00:00 2001 From: John Bond Date: Mon, 11 Jan 2021 19:56:44 +0100 Subject: [PATCH] MODULES-10915: use facter 3 for spec test This likely needs fixing in pdk or .sync but wanted to at least test the fix first --- .travis.yml | 4 ++++ lib/facter/lvm_support.rb | 4 +++- spec/unit/facter/lvm_support_spec.rb | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6862e8cc..9e47745c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/lib/facter/lvm_support.rb b/lib/facter/lvm_support.rb index 64ce7107..318e8e31 100644 --- a/lib/facter/lvm_support.rb +++ b/lib/facter/lvm_support.rb @@ -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') diff --git a/spec/unit/facter/lvm_support_spec.rb b/spec/unit/facter/lvm_support_spec.rb index b529b721..56bd2cf0 100644 --- a/spec/unit/facter/lvm_support_spec.rb +++ b/spec/unit/facter/lvm_support_spec.rb @@ -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