summaryrefslogtreecommitdiff
path: root/spec/unit/facter/pe_version_spec.rb
diff options
context:
space:
mode:
authorHunter Haugen <hunter@puppetlabs.com>2015-10-15 10:23:02 -0700
committerHunter Haugen <hunter@puppetlabs.com>2015-10-15 10:23:02 -0700
commit39126a7bc82797799280231fef7ef9706a113c6c (patch)
tree05d11f2ac10ff221a285e84659e677d7dfa753d8 /spec/unit/facter/pe_version_spec.rb
parent57a8485223c221aa075d09c0a7de816a26daf1b0 (diff)
parent6aa7f2db9953d81afb75a3591358ba9e0dbc6935 (diff)
downloadpuppet-stdlib-39126a7bc82797799280231fef7ef9706a113c6c.tar.gz
puppet-stdlib-39126a7bc82797799280231fef7ef9706a113c6c.tar.bz2
Merge pull request #539 from mentat/MODULES-2696
Add check to ensure regex does not throw for none type.
Diffstat (limited to 'spec/unit/facter/pe_version_spec.rb')
-rwxr-xr-xspec/unit/facter/pe_version_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/facter/pe_version_spec.rb b/spec/unit/facter/pe_version_spec.rb
index 4d0349e..c11a1cd 100755
--- a/spec/unit/facter/pe_version_spec.rb
+++ b/spec/unit/facter/pe_version_spec.rb
@@ -14,6 +14,17 @@ describe "PE Version specs" do
Facter.collection.loader.load(:pe_version)
end
end
+
+ context "When puppetversion is nil" do
+ before :each do
+ Facter.fact(:puppetversion).stubs(:value).returns(nil)
+ end
+
+ it "pe_version is nil" do
+ expect(Facter.fact(:puppetversion).value).to be_nil
+ expect(Facter.fact(:pe_version).value).to be_nil
+ end
+ end
context "If PE is installed" do
%w{ 2.6.1 2.10.300 }.each do |version|
@@ -73,4 +84,5 @@ describe "PE Version specs" do
expect(Facter.fact(:pe_patch_version).value).to be_nil
end
end
+
end