We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9deee73 + a76ae47 commit 78a9f15Copy full SHA for 78a9f15
lib/puppet/type/tidy.rb
@@ -144,7 +144,7 @@ def convert(unit, multi)
144
145
def tidy?(path, stat)
146
# If the file's older than we allow, we should get rid of it.
147
- (Time.now.to_i - stat.send(resource[:type]).to_i) > value
+ (Time.now.to_i - stat.send(resource[:type]).to_i) >= value
148
end
149
150
munge do |age|
spec/unit/type/tidy_spec.rb
@@ -280,6 +280,13 @@
280
@ager.tidy?(@basepath, @stat)
281
282
283
+ it "should return true if the specified age is 0" do
284
+ @tidy[:age] = "0"
285
+ expect(@stat).to receive(:mtime).and_return(Time.now)
286
+
287
+ expect(@ager).to be_tidy(@basepath, @stat)
288
+ end
289
290
it "should return false if the file is more recent than the specified age" do
291
expect(@stat).to receive(:mtime).and_return(Time.now)
292
0 commit comments