3 describe 'apt_update_last_success fact' do
4 subject { Facter.fact(:apt_update_last_success).value }
5 before(:each) { Facter.clear }
6 after(:each) { Facter.clear }
8 describe 'on Debian based distro which has not yet created the update-success-stamp file' do
9 it 'should have a value of -1' do
10 Facter.fact(:osfamily).stubs(:value).returns 'Debian'
11 File.expects(:exists?).with('/var/lib/apt/periodic/update-success-stamp').returns false
16 describe 'on Debian based distro which has created the update-success-stamp' do
17 it 'should have the value of the mtime of the file' do
18 Facter.fact(:osfamily).stubs(:value).returns 'Debian'
19 File.stubs(:exists?).returns true
20 File.stubs(:mtime).returns 1407660561
21 is_expected.to eq(1407660561)