This repository has been archived by the owner on Jun 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs #15217 - puppet 4 support (#10)
- Loading branch information
Showing
4 changed files
with
80 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,66 @@ | ||
require 'spec_helper' | ||
|
||
describe 'crane' do | ||
let :default_facts do | ||
{ | ||
:fqdn => 'localhost.localdomain', | ||
:concat_basedir => '/tmp', | ||
:interfaces => '', | ||
:operatingsystem => 'RedHat', | ||
:operatingsystemrelease => '6.4', | ||
:operatingsystemmajrelease => '6.4', | ||
:osfamily => 'RedHat', | ||
:processorcount => 3 | ||
} | ||
end | ||
on_supported_os.each do |os, facts| | ||
context "os #{os}" do | ||
let :default_facts do | ||
facts.merge(:concat_basedir => '/tmp') | ||
end | ||
|
||
context 'with no parameters' do | ||
let :pre_condition do | ||
"class {'crane':}" | ||
end | ||
context 'with no parameters' do | ||
let :pre_condition do | ||
"class {'crane':}" | ||
end | ||
|
||
let :facts do | ||
default_facts | ||
end | ||
let :facts do | ||
default_facts | ||
end | ||
|
||
it "should set up the config file" do | ||
should contain_file('/etc/crane.conf'). | ||
with({ | ||
'ensure' => 'file', | ||
'owner' => 'root', | ||
'group' => 'root', | ||
'mode' => '0644', | ||
}). | ||
with_content(/^endpoint: localhost.localdomain:5000$/) | ||
end | ||
end | ||
it "should set up the config file" do | ||
should contain_file('/etc/crane.conf'). | ||
with({ | ||
'ensure' => 'file', | ||
'owner' => 'root', | ||
'group' => 'root', | ||
'mode' => '0644', | ||
}). | ||
with_content(/^endpoint: foo.example.com:5000$/) | ||
end | ||
end | ||
|
||
context 'with parameters' do | ||
let :pre_condition do | ||
"class {'crane': | ||
port => 5001 | ||
}" | ||
end | ||
context 'with parameters' do | ||
let :pre_condition do | ||
"class {'crane': | ||
port => 5001 | ||
}" | ||
end | ||
|
||
let :facts do | ||
default_facts | ||
end | ||
let :facts do | ||
default_facts | ||
end | ||
|
||
it "should set the port" do | ||
should contain_file('/etc/crane.conf'). | ||
with_content(/^endpoint: localhost.localdomain:5001$/) | ||
end | ||
end | ||
it "should set the port" do | ||
should contain_file('/etc/crane.conf'). | ||
with_content(/^endpoint: foo.example.com:5001$/) | ||
end | ||
end | ||
|
||
context 'with data dir ' do | ||
let :pre_condition do | ||
"class {'crane': | ||
data_dir => 'foo' | ||
}" | ||
end | ||
context 'with data dir ' do | ||
let :pre_condition do | ||
"class {'crane': | ||
data_dir => 'foo' | ||
}" | ||
end | ||
|
||
let :facts do | ||
default_facts | ||
end | ||
let :facts do | ||
default_facts | ||
end | ||
|
||
it "should set the data_dir" do | ||
should contain_file('/etc/crane.conf'). | ||
with_content(/^data_dir: foo$/) | ||
it "should set the data_dir" do | ||
should contain_file('/etc/crane.conf'). | ||
with_content(/^data_dir: foo$/) | ||
end | ||
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,14 @@ | ||
require 'spec_helper' | ||
|
||
describe 'crane' do | ||
|
||
context 'on redhat' do | ||
let :facts do | ||
{ | ||
:concat_basedir => '/tmp', | ||
:operatingsystem => 'RedHat', | ||
:operatingsystemrelease => '6.4', | ||
:operatingsystemmajrelease => '6.4', | ||
:osfamily => 'RedHat', | ||
} | ||
on_supported_os.each do |os, facts| | ||
context "on #{os}" do | ||
let :facts do | ||
facts.merge(:concat_basedir => '/tmp') | ||
end | ||
|
||
it { should contain_class('crane::install') } | ||
it { should contain_class('crane::config') } | ||
end | ||
|
||
it { should contain_class('crane::install') } | ||
it { should contain_class('crane::config') } | ||
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