Spec tests are now running correctly
This commit is contained in:
parent
a992774aab
commit
189fc932e7
@ -2,8 +2,7 @@ fixtures:
|
|||||||
forge_modules:
|
forge_modules:
|
||||||
concat:
|
concat:
|
||||||
repo: "puppetlabs/concat"
|
repo: "puppetlabs/concat"
|
||||||
ref: "1.0.0"
|
ref: "2.2.1"
|
||||||
stdlib: "puppetlabs/stdlib"
|
stdlib: "puppetlabs/stdlib"
|
||||||
module_data: "ripienaar/module_data"
|
|
||||||
symlinks:
|
symlinks:
|
||||||
bind: "#{source_dir}"
|
bind: "#{source_dir}"
|
||||||
|
|||||||
11
.gitignore
vendored
11
.gitignore
vendored
@ -1 +1,12 @@
|
|||||||
pkg/
|
pkg/
|
||||||
|
.*.sw?
|
||||||
|
spec/fixtures
|
||||||
|
Gemfile.lock
|
||||||
|
.rspec_system
|
||||||
|
.vagrant
|
||||||
|
.bundle
|
||||||
|
vendor
|
||||||
|
junit
|
||||||
|
log
|
||||||
|
.yardoc
|
||||||
|
coverage
|
||||||
|
|||||||
@ -7,29 +7,33 @@ describe 'bind' do
|
|||||||
{
|
{
|
||||||
:concat_basedir => '/wtf',
|
:concat_basedir => '/wtf',
|
||||||
:osfamily => 'Debian',
|
:osfamily => 'Debian',
|
||||||
|
:os => {
|
||||||
|
:family => 'Debian',
|
||||||
|
},
|
||||||
:operatingsystem => 'Debian'
|
:operatingsystem => 'Debian'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it {
|
it { is_expected.to compile }
|
||||||
|
it do
|
||||||
should contain_package('bind-tools').with({
|
should contain_package('bind-tools').with({
|
||||||
'ensure' => 'latest',
|
ensure: 'present',
|
||||||
'name' => 'dnsutils'
|
name: 'dnsutils'
|
||||||
}).that_comes_before('Package[bind]')
|
|
||||||
}
|
|
||||||
it {
|
|
||||||
should contain_package('bind').with({
|
|
||||||
'ensure' => 'latest',
|
|
||||||
'name' => 'bind9'
|
|
||||||
})
|
})
|
||||||
}
|
end
|
||||||
|
it do
|
||||||
|
should contain_package('bind').with({
|
||||||
|
ensure: 'latest',
|
||||||
|
name: 'bind9'
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
it { should contain_file('_NAMEDCONF_').that_requires('Package[bind]') }
|
it { should contain_file('/etc/bind/named.conf').that_requires('Package[bind]') }
|
||||||
it { should contain_file('_NAMEDCONF_').that_notifies('Service[bind]') }
|
it { should contain_file('/etc/bind/named.conf').that_notifies('Service[bind]') }
|
||||||
|
|
||||||
it {
|
it {
|
||||||
should contain_service('bind').with({
|
should contain_service('bind').with({
|
||||||
'ensure' => 'running',
|
ensure: 'running',
|
||||||
'name' => 'bind9'
|
name: 'bind9'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -38,12 +42,15 @@ describe 'bind' do
|
|||||||
{
|
{
|
||||||
:concat_basedir => '/wtf',
|
:concat_basedir => '/wtf',
|
||||||
:osfamily => 'RedHat',
|
:osfamily => 'RedHat',
|
||||||
|
:os => {
|
||||||
|
:family => 'RedHat',
|
||||||
|
},
|
||||||
:operatingsystem => 'CentOS'
|
:operatingsystem => 'CentOS'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it {
|
it {
|
||||||
should contain_package('bind-tools').with({
|
should contain_package('bind-tools').with({
|
||||||
'ensure' => 'latest',
|
'ensure' => 'present',
|
||||||
'name' => 'bind-utils'
|
'name' => 'bind-utils'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -54,8 +61,8 @@ describe 'bind' do
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
it { should contain_file('_NAMEDCONF_').that_requires('Package[bind]') }
|
it { should contain_file('/etc/named.conf').that_requires('Package[bind]') }
|
||||||
it { should contain_file('_NAMEDCONF_').that_notifies('Service[bind]') }
|
it { should contain_file('/etc/named.conf').that_notifies('Service[bind]') }
|
||||||
|
|
||||||
it {
|
it {
|
||||||
should contain_service('bind').with({
|
should contain_service('bind').with({
|
||||||
|
|||||||
3
spec/fixtures/hiera/common.yaml
vendored
3
spec/fixtures/hiera/common.yaml
vendored
@ -1,3 +0,0 @@
|
|||||||
---
|
|
||||||
bind::defaults::confdir: '_CONFDIR_'
|
|
||||||
bind::defaults::namedconf: '_NAMEDCONF_'
|
|
||||||
9
spec/fixtures/hiera/hiera.yaml
vendored
9
spec/fixtures/hiera/hiera.yaml
vendored
@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
:hierarchy:
|
|
||||||
- "tests/%{::test_config}"
|
|
||||||
- common
|
|
||||||
:backends:
|
|
||||||
- yaml
|
|
||||||
- module_data
|
|
||||||
:yaml:
|
|
||||||
:datadir: 'spec/fixtures/hiera'
|
|
||||||
@ -1,14 +1,21 @@
|
|||||||
|
|
||||||
require 'puppetlabs_spec_helper/module_spec_helper'
|
require 'puppetlabs_spec_helper/module_spec_helper'
|
||||||
require 'fixtures/modules/module_data/lib/hiera/backend/module_data_backend.rb'
|
require 'rspec-puppet-facts'
|
||||||
|
|
||||||
|
include RspecPuppetFacts
|
||||||
|
|
||||||
|
require 'simplecov'
|
||||||
|
require 'simplecov-console'
|
||||||
|
|
||||||
|
SimpleCov.start do
|
||||||
|
add_filter '/spec'
|
||||||
|
add_filter '/vendor'
|
||||||
|
formatter SimpleCov::Formatter::MultiFormatter.new([
|
||||||
|
SimpleCov::Formatter::HTMLFormatter,
|
||||||
|
SimpleCov::Formatter::Console
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
RSpec.configure do |c|
|
RSpec.configure do |c|
|
||||||
c.default_facts = {
|
c.hiera_config = File.expand_path(File.join(__FILE__, '../fixtures/hiera.yaml'))
|
||||||
:osfamily => 'Debian',
|
|
||||||
:operatingsystem => 'Debian',
|
|
||||||
:lsbdistcodename => 'wheezy',
|
|
||||||
:architecture => 'amd64',
|
|
||||||
:kernel => 'Linux',
|
|
||||||
:test_config => 'default'
|
|
||||||
}
|
|
||||||
c.hiera_config = File.join('spec', 'fixtures', 'hiera', 'hiera.yaml')
|
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user