Skip to content

Commit f10a338

Browse files
author
tphoney
committed
calculate undef dependant on version
1 parent d9536a8 commit f10a338

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spec/functions/is_string_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
require 'spec_helper'
22

33
describe 'is_string' do
4+
let(:undef_value) do
5+
(Puppet::Util::Package.versioncmp(Puppet.version, '6.0.0') < 0) ? :undef : nil
6+
end
7+
48
it { is_expected.not_to eq(nil) }
59
it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
610
it {
@@ -18,7 +22,7 @@
1822
it { is_expected.to run.with_params(-3.7).and_return(false) }
1923
it { is_expected.to run.with_params('-3.7').and_return(false) }
2024

21-
it { is_expected.to run.with_params(undef).and_return(false) }
25+
it { is_expected.to run.with_params(undef_value).and_return(false) }
2226
it { is_expected.to run.with_params([]).and_return(false) }
2327
it { is_expected.to run.with_params([1]).and_return(false) }
2428
it { is_expected.to run.with_params({}).and_return(false) }

0 commit comments

Comments
 (0)