From 2c656517bd463f23996f50c2e49503909df06173 Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 7 Dec 2015 19:44:14 +0100 Subject: [rspec] extend test for custom facts --- spec/unit/custom_facts_spec.rb | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/spec/unit/custom_facts_spec.rb b/spec/unit/custom_facts_spec.rb index 2d36bd7..9a28d92 100644 --- a/spec/unit/custom_facts_spec.rb +++ b/spec/unit/custom_facts_spec.rb @@ -21,6 +21,14 @@ describe "Facter::Util::Fact" do it "debian_codename = wheezy" do expect(Facter.fact(:debian_codename).value).to eq('wheezy') end + + it "debian_nextcodename = jessie" do + expect(Facter.fact(:debian_nextcodename).value).to eq('jessie') + end + + it "debian_nextrelease = stable" do + expect(Facter.fact(:debian_nextrelease).value).to eq('stable') + end end context 'Debian 8' do @@ -37,20 +45,31 @@ describe "Facter::Util::Fact" do it "debian_codename = jessie" do expect(Facter.fact(:debian_codename).value).to eq('jessie') end + + it "debian_nextcodename = stretch" do + expect(Facter.fact(:debian_nextcodename).value).to eq('stretch') + end + + it "debian_nextrelease = testing" do + expect(Facter.fact(:debian_nextrelease).value).to eq('testing') + end end context 'Ubuntu 15.10' do before do Facter.fact(:operatingsystem).stubs(:value).returns("Ubuntu") Facter.fact(:operatingsystemrelease).stubs(:value).returns("15.10") - Facter.fact(:lsbdistcodename).stubs(:value).returns("Vivid") + Facter.fact(:lsbdistcodename).stubs(:value).returns("wily") end - it "ubuntu_codename = Vivid" do - expect(Facter.fact(:ubuntu_codename).value).to eq('Vivid') + it "ubuntu_codename = wily" do + expect(Facter.fact(:ubuntu_codename).value).to eq('wily') end - end + it "ubuntu_nextcodename = xenial" do + expect(Facter.fact(:ubuntu_nextcodename).value).to eq('xenial') + end + end end describe "Test 'apt_running' fact" do -- cgit v1.2.3