Initial import

This commit is contained in:
t0xicCode
2015-04-16 18:04:30 -04:00
commit 3eef672af2
17 changed files with 467 additions and 0 deletions

29
spec/classes/init_spec.rb Normal file
View File

@ -0,0 +1,29 @@
require 'spec_helper'
describe 'nslcd' do
{'Ubuntu' => 'Debian', 'Debian' => 'Debian'}.each do |system, family|
context "when on system #{system}" do
let :facts do
{
:osfamily => family,
:operatingsystem => system,
}
end
it { should contain_class('nslcd') }
it { should contain_class('nslcd::install') }
it { should contain_class('nslcd::config') }
it { should contain_class('nslcd::service') }
it {
should contain_package('nslcd')
should contain_service('nslcd')
}
end
end
context 'when on an unknown system' do
it { expect { should raise_error(Puppet::Error) } }
end
end

6
spec/spec.opts Normal file
View File

@ -0,0 +1,6 @@
--format
s
--colour
--loadby
mtime
--backtrace

28
spec/spec_helper.rb Normal file
View File

@ -0,0 +1,28 @@
require 'puppetlabs_spec_helper/module_spec_helper'
RSpec.configure do |c|
c.include PuppetlabsSpec::Files
c.before :each do
# Ensure that we don't accidentally cache facts and environment
# between test cases.
Facter::Util::Loader.any_instance.stubs(:load_all)
Facter.clear
Facter.clear_messages
# Store any environment variables away to be restored later
@old_env = {}
ENV.each_key {|k| @old_env[k] = ENV[k]}
if Gem::Version.new(`puppet --version`) >= Gem::Version.new('3.5')
Puppet.settings[:strict_variables]=true
end
if ENV['PARSER']
Puppet.settings[:parser]=ENV['PARSER']
end
end
c.after :each do
PuppetlabsSpec::Files.cleanup
end
end