Skip to content

Commit

Permalink
Add more tests for package selector
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-mueller committed Mar 4, 2016
1 parent 06f109f commit 30024ee
Showing 1 changed file with 74 additions and 2 deletions.
76 changes: 74 additions & 2 deletions spec/classes/install_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,80 @@
require 'spec_helper'

describe 'cron::install' do
it do
should contain_package( 'cron' ).with( 'ensure' => 'installed' )
context 'default' do
it do
should contain_package( 'cron' ).with( 'ensure' => 'installed', 'name' => 'cron' )
end
end

context 'CentOS 5' do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystem => 'CentOS',
:operatingsystemmajrelease => '5',
}
end
it { should contain_class( 'cron::install' ) }
it { should contain_package( 'cron' ).with(
'name' => 'vixie-cron'
)
}
end

context 'CentOS 6' do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystem => 'CentOS',
:operatingsystemmajrelease => '6',
}
end
it { should contain_class( 'cron::install' ) }
it { should contain_package( 'cron' ).with(
'name' => 'cronie'
)
}
end

context 'Gentoo' do
let :facts do
{
:operatingsystem => 'Gentoo',
}
end
it { should contain_class( 'cron::install' ) }
it { should contain_package( 'cron' ).with(
'name' => 'sys-process/vixie-cron'
)
}
end

context 'Ubuntu' do
let :facts do
{
:operatingsystem => 'Ubuntu',
}
end
it { should contain_class( 'cron::install' ) }
it { should contain_package( 'cron' ).with(
'name' => 'cron'
)
}
end

context 'Debian' do
let :facts do
{
:operatingsystem => 'Debian',
}
end
it { should contain_class( 'cron::install' ) }
it { should contain_package( 'cron' ).with(
'name' => 'cron'
)
}
end

end

0 comments on commit 30024ee

Please sign in to comment.