-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* (More) consistently use `.dig` to retrieve facts * Supply missing facts in tests
- Loading branch information
Showing
63 changed files
with
1,773 additions
and
1,468 deletions.
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
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
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
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 |
---|---|---|
@@ -1,31 +1,35 @@ | ||
require 'spec_helper' | ||
|
||
describe 'simplib::ldap::domain_to_dn' do | ||
on_supported_os.each_value do |os_facts| | ||
context 'with a regular domain' do | ||
let(:facts) do | ||
os_facts[:networking][:domain] = 'test.domain' | ||
os_facts | ||
end | ||
on_supported_os.each do |os, os_facts| | ||
context "on #{os}" do | ||
let(:facts) { os_facts } | ||
|
||
it { is_expected.to run.and_return('DC=test,DC=domain') } | ||
end | ||
context 'with a regular domain' do | ||
let(:facts) do | ||
os_facts[:networking][:domain] = 'test.domain' | ||
os_facts | ||
end | ||
|
||
context 'with a short domain' do | ||
let(:facts) do | ||
os_facts[:networking][:domain] = 'domain' | ||
os_facts | ||
it { is_expected.to run.and_return('DC=test,DC=domain') } | ||
end | ||
|
||
it { is_expected.to run.and_return('DC=domain') } | ||
end | ||
context 'with a short domain' do | ||
let(:facts) do | ||
os_facts[:networking][:domain] = 'domain' | ||
os_facts | ||
end | ||
|
||
context 'when passed a domain' do | ||
it { is_expected.to run.with_params('test.domain').and_return('DC=test,DC=domain') } | ||
end | ||
it { is_expected.to run.and_return('DC=domain') } | ||
end | ||
|
||
context 'when passed a domain' do | ||
it { is_expected.to run.with_params('test.domain').and_return('DC=test,DC=domain') } | ||
end | ||
|
||
context 'when told to downcase the attributes' do | ||
it { is_expected.to run.with_params('test.domain', true).and_return('dc=test,dc=domain') } | ||
context 'when told to downcase the attributes' do | ||
it { is_expected.to run.with_params('test.domain', true).and_return('dc=test,dc=domain') } | ||
end | ||
end | ||
end | ||
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 |
---|---|---|
@@ -1,30 +1,36 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Simplib::Cron::Hour_entry' do | ||
context 'with valid parameters' do | ||
it { is_expected.to allow_value('22') } | ||
it { is_expected.to allow_value('*') } | ||
it { is_expected.to allow_value('*/5') } | ||
it { is_expected.to allow_value('2/5') } | ||
it { is_expected.to allow_value(22) } | ||
it { is_expected.to allow_value('23,20') } | ||
it { is_expected.to allow_value('20-23') } | ||
it { is_expected.to allow_value('0-23/2') } | ||
end | ||
context 'with invalid parameters' do | ||
it { is_expected.not_to allow_value('one') } | ||
it { is_expected.not_to allow_value('-2') } | ||
it { is_expected.not_to allow_value('/3') } | ||
it { is_expected.not_to allow_value('24') } | ||
it { is_expected.not_to allow_value('13/*') } | ||
it { is_expected.not_to allow_value('13-/15') } | ||
end | ||
context 'with silly things' do | ||
it { is_expected.not_to allow_value([]) } | ||
it { is_expected.not_to allow_value('.') } | ||
it { is_expected.not_to allow_value('') } | ||
it { is_expected.not_to allow_value('1 ') } | ||
it { is_expected.not_to allow_value('5 1') } | ||
it { is_expected.not_to allow_value(:undef) } | ||
on_supported_os.each do |os, os_facts| | ||
context "on #{os}" do | ||
let(:facts) { os_facts } | ||
|
||
context 'with valid parameters' do | ||
it { is_expected.to allow_value('22') } | ||
it { is_expected.to allow_value('*') } | ||
it { is_expected.to allow_value('*/5') } | ||
it { is_expected.to allow_value('2/5') } | ||
it { is_expected.to allow_value(22) } | ||
it { is_expected.to allow_value('23,20') } | ||
it { is_expected.to allow_value('20-23') } | ||
it { is_expected.to allow_value('0-23/2') } | ||
end | ||
context 'with invalid parameters' do | ||
it { is_expected.not_to allow_value('one') } | ||
it { is_expected.not_to allow_value('-2') } | ||
it { is_expected.not_to allow_value('/3') } | ||
it { is_expected.not_to allow_value('24') } | ||
it { is_expected.not_to allow_value('13/*') } | ||
it { is_expected.not_to allow_value('13-/15') } | ||
end | ||
context 'with silly things' do | ||
it { is_expected.not_to allow_value([]) } | ||
it { is_expected.not_to allow_value('.') } | ||
it { is_expected.not_to allow_value('') } | ||
it { is_expected.not_to allow_value('1 ') } | ||
it { is_expected.not_to allow_value('5 1') } | ||
it { is_expected.not_to allow_value(:undef) } | ||
end | ||
end | ||
end | ||
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 |
---|---|---|
@@ -1,20 +1,26 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Simplib::Cron::Hour' do | ||
context 'with valid parameters' do | ||
it { is_expected.to allow_value([22]) } | ||
it { is_expected.to allow_value(['22']) } | ||
it { is_expected.to allow_value(['20-23', '10-14/2', 3, 5, '19']) } | ||
it { is_expected.to allow_value(22) } | ||
it { is_expected.to allow_value('22') } | ||
it { is_expected.to allow_value('20-23') } | ||
it { is_expected.to allow_value('*') } | ||
it { is_expected.to allow_value('*/5') } | ||
it { is_expected.to allow_value('0-23/2') } | ||
end | ||
context 'with invalid parameters' do | ||
it { is_expected.not_to allow_value(['20-23', '10-14/2', 3, 24, 5, '19']) } | ||
it { is_expected.not_to allow_value(['0,1,12-19,5']) } | ||
it { is_expected.not_to allow_value(["'0','1','12-19','5'"]) } | ||
on_supported_os.each do |os, os_facts| | ||
context "on #{os}" do | ||
let(:facts) { os_facts } | ||
|
||
context 'with valid parameters' do | ||
it { is_expected.to allow_value([22]) } | ||
it { is_expected.to allow_value(['22']) } | ||
it { is_expected.to allow_value(['20-23', '10-14/2', 3, 5, '19']) } | ||
it { is_expected.to allow_value(22) } | ||
it { is_expected.to allow_value('22') } | ||
it { is_expected.to allow_value('20-23') } | ||
it { is_expected.to allow_value('*') } | ||
it { is_expected.to allow_value('*/5') } | ||
it { is_expected.to allow_value('0-23/2') } | ||
end | ||
context 'with invalid parameters' do | ||
it { is_expected.not_to allow_value(['20-23', '10-14/2', 3, 24, 5, '19']) } | ||
it { is_expected.not_to allow_value(['0,1,12-19,5']) } | ||
it { is_expected.not_to allow_value(["'0','1','12-19','5'"]) } | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.