Add an assertion.

Mostly, this implies adding all of the boilerplate needed to start using
rspec-puppet with fixtures and whatnot.
This commit is contained in:
Nate Riffe 2014-12-15 14:05:53 -06:00
parent bf7f5f93fc
commit 636e77356a
8 changed files with 82 additions and 11 deletions

9
.fixtures.yml Normal file
View File

@ -0,0 +1,9 @@
---
fixtures:
forge_modules:
concat:
repo: "puppetlabs/concat"
ref: "1.0.0"
stdlib: "puppetlabs/stdlib"
symlinks:
bind: "#{source_dir}"

1
.ruby-gemset Normal file
View File

@ -0,0 +1 @@
puppet-bind

1
.ruby-version Normal file
View File

@ -0,0 +1 @@
2.0.0

View File

@ -10,3 +10,4 @@ gem 'rake'
gem 'puppet', puppetversion
gem 'puppet-lint'
gem 'rspec-puppet'
gem 'puppetlabs_spec_helper'

51
Gemfile.lock Normal file
View File

@ -0,0 +1,51 @@
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.2.5)
facter (1.7.6)
hiera (1.3.4)
json_pure
json_pure (1.8.1)
metaclass (0.0.4)
mocha (1.1.0)
metaclass (~> 0.0.1)
puppet (3.4.3)
facter (~> 1.6)
hiera (~> 1.0)
rgen (~> 0.6.5)
puppet-lint (1.1.0)
puppet-syntax (1.3.0)
rake
puppetlabs_spec_helper (0.8.2)
mocha
puppet-lint
puppet-syntax
rake
rspec
rspec-puppet
rake (10.4.2)
rgen (0.6.6)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-puppet (1.0.1)
rspec
rspec-support (3.1.2)
PLATFORMS
ruby
DEPENDENCIES
puppet (~> 3.4.1)
puppet-lint
puppetlabs_spec_helper
rake
rspec-puppet

View File

@ -1,10 +1,6 @@
# ex: syntax=ruby ts=2 ts=2 si et
require 'puppet-lint/tasks/puppet-lint'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new :spec do |t|
t.pattern = 'spec/*/*_spec.rb'
end
require 'puppetlabs_spec_helper/rake_tasks'
Rake::Task[:lint].clear
PuppetLint::RakeTask.new :lint do |config|

17
spec/classes/bind_spec.rb Normal file
View File

@ -0,0 +1,17 @@
# ex: syntax=ruby ts=2 sw=2 si et
require 'spec_helper'
describe 'bind' do
let(:facts) { { :concat_basedir => '/wtf' } }
context 'on Debian-derived systems' do
let(:facts) { super().merge({ :osfamily => 'Debian' }) }
it { should contain_package('bind').with({
'ensure' => 'latest',
'name' => 'bind9'
})
}
end
end

View File

@ -1,6 +1 @@
require 'rspec-puppet'
RSpec.configure do |c|
c.module_path = File.expand(File.join(__FILE__, '..', 'fixtures', 'modules'))
c.manifest_dir = File.expand(File.join(__FILE__, '..', 'fixtures', 'manifests'))
end
require 'puppetlabs_spec_helper/module_spec_helper'