Created
October 6, 2015 06:00
-
-
Save udzura/145235b2b090bda4bc44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'cron on log' do | |
describe cron do | |
def self.expect_to_have_tempwatch_entry_of(dir, deletes_before: 24 * 30 * 1) | |
it { | |
should have_entry("0 3 * * * /usr/sbin/tmpwatch -m #{deletes_before} -d #{dir}") | |
.with_user('root') | |
} | |
end | |
expect_to_have_tempwatch_entry_of "/data/log/foo", deletes_before: 24 * 30 * 1 | |
expect_to_have_tempwatch_entry_of "/data/log/foo/www-", deletes_before: 24 * 14 | |
expect_to_have_tempwatch_entry_of "/data/log/foo/www-ssl", deletes_before: 24 * 14 | |
expect_to_have_tempwatch_entry_of "/data/log/foo/other", deletes_before: 24 * 14 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment