Skip to content

Commit

Permalink
Merge pull request thias#51 from NexusIS/master
Browse files Browse the repository at this point in the history
Add missing bind tools package and improve rspec tests
  • Loading branch information
inkblot committed Jul 11, 2015
2 parents aeffbe2 + 0479c58 commit c178d73
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 15 deletions.
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
notify => Service['bind'],
}

package{'bind-tools':
ensure => latest,
name => $::bind::params::nsupdate_package,
before => Package['bind'],
}

package { 'bind':
ensure => latest,
name => $::bind::params::bind_package,
Expand Down
73 changes: 58 additions & 15 deletions spec/classes/bind_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,66 @@
require 'spec_helper'

describe 'bind' do
let(:facts) { { :concat_basedir => '/wtf' } }
context "on a Debian OS" do
let :facts do
{
:concat_basedir => '/wtf',
:osfamily => 'Debian',
:operatingsystem => 'Debian'
}
end
it {
should contain_package('bind-tools').with({
'ensure' => 'latest',
'name' => 'dnsutils'
}).that_comes_before('Package[bind]')
}
it {
should contain_package('bind').with({
'ensure' => 'latest',
'name' => 'bind9'
})
}

it {
should contain_package('bind').with({
'ensure' => 'latest',
'name' => 'bind9'
})
}
it { should contain_file('_NAMEDCONF_').that_requires('Package[bind]') }
it { should contain_file('_NAMEDCONF_').that_notifies('Service[bind]') }

it { should contain_file('_NAMEDCONF_').that_requires('Package[bind]') }
it { should contain_file('_NAMEDCONF_').that_notifies('Service[bind]') }
it {
should contain_service('bind').with({
'ensure' => 'running',
'name' => 'bind9'
})
}
end
context "on a RedHat OS" do
let :facts do
{
:concat_basedir => '/wtf',
:osfamily => 'RedHat',
:operatingsystem => 'CentOS'
}
end
it {
should contain_package('bind-tools').with({
'ensure' => 'latest',
'name' => 'bind-utils'
})
}
it {
should contain_package('bind').with({
'ensure' => 'latest',
'name' => 'bind'
})
}

it {
should contain_service('bind').with({
'ensure' => 'running',
'name' => 'bind9'
})
}
it { should contain_file('_NAMEDCONF_').that_requires('Package[bind]') }
it { should contain_file('_NAMEDCONF_').that_notifies('Service[bind]') }

it {
should contain_service('bind').with({
'ensure' => 'running',
'name' => 'named'
})
}
end
end

0 comments on commit c178d73

Please sign in to comment.