Code Review
/
puppet-modules
/
puppetlabs-apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge pull request #759 from puppetlabs/pdksync_heads/master-0-g34e3266
[puppet-modules/puppetlabs-apt.git]
/
spec
/
unit
/
facter
/
apt_update_last_success_spec.rb
diff --git
a/spec/unit/facter/apt_update_last_success_spec.rb
b/spec/unit/facter/apt_update_last_success_spec.rb
index 14bc3ab3bd35a706ed2b84d742bbfcf2d4e7626f..60d727302c6ddade0a78ca89999d0aa54efbeb4d 100644
(file)
--- a/
spec/unit/facter/apt_update_last_success_spec.rb
+++ b/
spec/unit/facter/apt_update_last_success_spec.rb
@@
-2,23
+2,24
@@
require 'spec_helper'
describe 'apt_update_last_success fact' do
subject { Facter.fact(:apt_update_last_success).value }
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
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
+ it '
has
a value of -1' do
Facter.fact(:osfamily).stubs(:value).returns 'Debian'
Facter.fact(:osfamily).stubs(:value).returns 'Debian'
- File.
stubs(:exists?
).returns false
+ File.
expects(:exist?).with('/var/lib/apt/periodic/update-success-stamp'
).returns false
is_expected.to eq(-1)
end
end
describe 'on Debian based distro which has created the update-success-stamp' do
is_expected.to eq(-1)
end
end
describe 'on Debian based distro which has created the update-success-stamp' do
- it '
should have
the value of the mtime of the file' do
+ it '
has
the value of the mtime of the file' do
Facter.fact(:osfamily).stubs(:value).returns 'Debian'
Facter.fact(:osfamily).stubs(:value).returns 'Debian'
- File.stubs(:exist
s
?).returns true
- File.stubs(:mtime).returns 1
407660
561
- is_expected.to eq(1
407660
561)
+ File.stubs(:exist?).returns true
+ File.stubs(:mtime).returns 1
_407_660_
561
+ is_expected.to eq(1
_407_660_
561)
end
end
end
end
-
end
end