module-puppetlabs-apt/spec/unit/facter/apt_updates_spec.rb
Damien Churchill 7eb9d00360 add facts showing available updates
Making use of the apt-check command from the 'update-notifier-common'
package (if available) display the number of available updates, number of
security updates as well as the update package names.
2014-06-27 11:21:58 +01:00

24 lines
599 B
Ruby

require 'spec_helper'
describe 'apt_updates fact' do
subject { Facter.fact(:apt_updates).value }
after(:each) { Facter.clear }
describe 'on Debian based distro missing update-notifier-common' do
before {
Facter.fact(:osfamily).stubs(:value).returns 'Debian'
File.stubs(:executable?).returns false
}
it { should == nil }
end
describe 'on Debian based distro' do
before {
Facter.fact(:osfamily).stubs(:value).returns 'Debian'
File.stubs(:executable?).returns true
Facter::Util::Resolution.stubs(:exec).returns '14;7'
}
it { should == 14 }
end
end