Add the machinery necessary to run rspec-puppet tests against these modules
This is largely cribbed from jenkins-infra RSpec tooling which can be found in <https://github.com/jenkins-infra/jenkins-infra/spec> For more information about how to use rspec-puppet see: <http://rspec-puppet.com/>
This commit is contained in:
parent
9383865893
commit
504983705a
|
@ -7,6 +7,8 @@ ssl/
|
|||
# Other files and folders
|
||||
.settings/
|
||||
.project
|
||||
*.sw*
|
||||
.ruby-*
|
||||
|
||||
.bundle
|
||||
Gemfile.lock
|
||||
|
|
6
Gemfile
6
Gemfile
|
@ -3,3 +3,9 @@ source "https://rubygems.org"
|
|||
gem 'r10k'
|
||||
gem 'hiera-eyaml'
|
||||
gem 'hiera-eyaml-gpg'
|
||||
|
||||
gem 'rspec', '~> 2.99'
|
||||
gem 'rspec-puppet'
|
||||
gem 'puppet', '~> 3.6.0'
|
||||
gem 'puppetlabs_spec_helper', :github => 'jenkins-infra/puppetlabs_spec_helper'
|
||||
gem 'serverspec'
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'orthrus' do
|
||||
context 'on ubuntu' do
|
||||
let(:facts) do
|
||||
{
|
||||
:asfosname => 'ubuntu',
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_package 'orthrus' }
|
||||
end
|
||||
end
|
|
@ -0,0 +1 @@
|
|||
node default { }
|
|
@ -0,0 +1,21 @@
|
|||
require 'rubygems'
|
||||
require 'rspec'
|
||||
require 'puppet'
|
||||
require 'puppetlabs_spec_helper/module_spec_helper'
|
||||
|
||||
RSpec.configure do |c|
|
||||
c.mock_with :rspec
|
||||
c.module_path = File.expand_path(File.dirname(__FILE__) + '/../modules')
|
||||
c.manifest = File.expand_path(File.dirname(__FILE__) + '/fixtures/site.pp')
|
||||
|
||||
c.default_facts = {
|
||||
:kernel => 'Linux',
|
||||
}
|
||||
|
||||
c.before(:each) do
|
||||
# Workaround until this is fixed:
|
||||
# <https://tickets.puppetlabs.com/browse/PUP-1547>
|
||||
require 'puppet/confine/exists'
|
||||
Puppet::Confine::Exists.any_instance.stubs(:which => '')
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue