Skip to content

Commit

Permalink
updating spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smbambling committed Sep 5, 2015
1 parent ecba08c commit 21c456e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
37 changes: 17 additions & 20 deletions spec/classes/erlang_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,6 @@
context 'on RedHat 5' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystemrelease => '5.9' } }

context "epel enabled" do
let(:params) {{ :epel_enable => true }}
it { should contain_class('epel') }
end

context "epel disabled" do
let(:params) {{ :epel_enable => false }}
it { should_not contain_class('epel') }
end

context 'with no parameters' do
it { should contain_package('erlang').with_ensure('present') }
it { should contain_exec('erlang-repo-download').with(
Expand Down Expand Up @@ -89,25 +79,32 @@
context 'on RedHat 6' do
let(:facts) { {:osfamily => 'RedHat', :operatingsystemrelease => '6.4' } }

context "epel enabled" do
let(:params) {{ :epel_enable => true }}
it { should contain_class('epel') }
context 'with no parameters' do
it { should contain_package('erlang').with_ensure('present') }
it { should contain_exec('erlang-repo-download').with(
'command' => 'curl -o /etc/yum.repos.d/erlang-solutions.repo http://packages.erlang-solutions.com/rpm/centos/erlang_solutions.repo',
'path' => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin'
)
}
end

context "epel disabled" do
let(:params) {{ :epel_enable => false }}
it { should_not contain_class('epel') }
end
context 'with a custom repository' do
let(:params) { {
'local_repo_location' => '/tmp/yum.repos.d/tmp.repo',
'remote_repo_location' => 'http://example.com/fake.repo',
} }

context 'with no parameters' do
it { should contain_package('erlang').with_ensure('present') }
it { should contain_exec('erlang-repo-download').with(
'command' => 'curl -o /tmp/yum.repos.d/tmp.repo http://example.com/fake.repo'
)
}
end

context 'with a custom version' do
let(:params) { {'version' => 'absent' } }
it { should contain_package('erlang').with_ensure('absent') }
end
end
end

context 'on SUSE' do
let(:facts) {{ :osfamily => 'SUSE', }}
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
puppet_install
puppet_module_install(:source => proj_root, :module_name => 'erlang')
shell('puppet module install puppetlabs-apt')
shell('puppet module install stahnma-epel')
end
end
4 changes: 1 addition & 3 deletions spec/system/erlang_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
describe 'The erlang puppet module' do
it 'should run without errors' do
pp = <<-EOS
class { 'erlang':
epel_enable => true
}
class { 'erlang': }
EOS

puppet_apply(pp) do |r|
Expand Down

0 comments on commit 21c456e

Please sign in to comment.