module-puppetlabs-apt/spec/unit/facter/apt_reboot_required_spec.rb

24 lines
627 B
Ruby
Raw Normal View History

require 'spec_helper'
describe 'apt_reboot_required fact' do
subject { Facter.fact(:apt_reboot_required).value }
after(:each) { Facter.clear }
describe 'if a reboot is required' do
before {
Facter.fact(:osfamily).stubs(:value).returns 'Debian'
File.stubs(:file?).returns true
}
it { expect(Facter.fact(:apt_reboot_required).value).to eq true }
end
describe 'if a reboot is not required' do
before {
Facter.fact(:osfamily).stubs(:value).returns 'Debian'
File.stubs(:file?).returns false
}
it { expect(Facter.fact(:apt_reboot_required).value).to eq false }
end
end