Initial import
This commit is contained in:
29
spec/classes/init_spec.rb
Normal file
29
spec/classes/init_spec.rb
Normal 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
6
spec/spec.opts
Normal file
@ -0,0 +1,6 @@
|
||||
--format
|
||||
s
|
||||
--colour
|
||||
--loadby
|
||||
mtime
|
||||
--backtrace
|
28
spec/spec_helper.rb
Normal file
28
spec/spec_helper.rb
Normal 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
|
Reference in New Issue
Block a user