-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'spec_helper' | ||
|
||
include Serverspec::Helper::Darwin | ||
|
||
describe 'Serverspec cron matchers of Darwin family' do | ||
it_behaves_like 'support cron have_entry matcher', '* * * * * /usr/local/bin/batch.sh' | ||
it_behaves_like 'support cron have_entry with user matcher', '* * * * * /usr/local/bin/batch.sh', 'root' | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'spec_helper' | ||
|
||
include Serverspec::Helper::Debian | ||
|
||
describe 'Serverspec cron matchers of Debian family' do | ||
it_behaves_like 'support cron have_entry matcher', '* * * * * /usr/local/bin/batch.sh' | ||
it_behaves_like 'support cron have_entry with user matcher', '* * * * * /usr/local/bin/batch.sh', 'root' | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'spec_helper' | ||
|
||
include Serverspec::Helper::Gentoo | ||
|
||
describe 'Serverspec cron matchers of Gentoo family' do | ||
it_behaves_like 'support cron have_entry matcher', '* * * * * /usr/local/bin/batch.sh' | ||
it_behaves_like 'support cron have_entry with user matcher', '* * * * * /usr/local/bin/batch.sh', 'root' | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'spec_helper' | ||
|
||
include Serverspec::Helper::RedHat | ||
|
||
describe 'Serverspec cron matchers of Red Hat family' do | ||
it_behaves_like 'support cron have_entry matcher', '* * * * * /usr/local/bin/batch.sh' | ||
it_behaves_like 'support cron have_entry with user matcher', '* * * * * /usr/local/bin/batch.sh', 'root' | ||
end |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'spec_helper' | ||
|
||
include Serverspec::Helper::Solaris | ||
|
||
describe 'Serverspec cron matchers of Solaris family' do | ||
it_behaves_like 'support cron have_entry matcher', '* * * * * /usr/local/bin/batch.sh' | ||
it_behaves_like 'support cron have_entry with user matcher', '* * * * * /usr/local/bin/batch.sh', 'root' | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
shared_examples_for 'support cron have_entry matcher' do |entry| | ||
describe 'have_cron_entry' do | ||
describe cron do | ||
it { should have_cron_entry entry } | ||
end | ||
|
||
describe cron do | ||
it { should_not have_cron_entry 'invalid entry' } | ||
end | ||
end | ||
end | ||
|
||
shared_examples_for 'support cron have_entry with user matcher' do |entry, user| | ||
describe 'have_cron_entry' do | ||
describe cron do | ||
it { should have_cron_entry(entry).with_user(user) } | ||
end | ||
|
||
describe cron do | ||
it { should_not have_cron_entry('invalid entry').with_user(user) } | ||
end | ||
end | ||
end |