(MODULES-4265) Detect security updates from multiple sources
[puppet-modules/puppetlabs-apt.git] / spec / unit / facter / apt_update_last_success_spec.rb
index 14bc3ab3bd35a706ed2b84d742bbfcf2d4e7626f..ada6aa58947aaf8c2ec4a324071a68dbf346da80 100644 (file)
@@ -2,12 +2,13 @@ require 'spec_helper'
 
 describe 'apt_update_last_success fact' do
   subject { Facter.fact(:apt_update_last_success).value }
+  before(:each) { Facter.clear }
   after(:each) { Facter.clear }
 
   describe 'on Debian based distro which has not yet created the update-success-stamp file' do
     it 'should have a value of -1' do
       Facter.fact(:osfamily).stubs(:value).returns 'Debian'
-      File.stubs(:exists?).returns false
+      File.expects(:exists?).with('/var/lib/apt/periodic/update-success-stamp').returns false
       is_expected.to eq(-1)
     end
   end