Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests #4

Merged
merged 4 commits into from
Feb 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fixtures:
repositories:
"concat": "git://github.com/puppetlabs/puppetlabs-concat.git"
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git"
symlinks:
"pbuilder": "#{source_dir}"
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
language: ruby
bundler_args: --without development
script: bundle exec rake spec SPEC_OPTS='--format documentation'
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
env:
matrix:
- PUPPET_GEM_VERSION="~> 2.7.0"
- PUPPET_GEM_VERSION="~> 3.2.0"
- PUPPET_GEM_VERSION="~> 3.4.0"
- PUPPET_GEM_VERSION="~> 3.5.0.rc3" STRICT_VARIABLES="yes"
matrix:
fast_finish: true
exclude:
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 2.7.0"
notifications:
email: false
16 changes: 16 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"

group :development, :test do
gem 'rake', '10.1.1'
gem 'puppetlabs_spec_helper', :require => false
gem 'rspec-puppet', '~> 1.0'
gem 'puppet-lint', '~> 0.3.2'
end

if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end

# vim:ft=ruby
11 changes: 11 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'rubygems'
require 'bundler/setup'

Bundler.require :default

require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'

task :default do
sh %{rake -T}
end
4 changes: 2 additions & 2 deletions manifests/cowbuilder.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define pbuilder::cowbuilder (
$ensure='present',
$dist=$lsbdistcodename,
$arch=$architecture,
$dist=$::lsbdistcodename,
$arch=$::architecture,
$cachedir='/var/cache/pbuilder',
$confdir='/etc/pbuilder',
$pbuilderrc=''
Expand Down
13 changes: 13 additions & 0 deletions spec/defines/cowbuilder_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'spec_helper'
describe 'pbuilder::cowbuilder' do
let (:title) { 'foo' }
let (:facts) { {
:osfamily => 'Debian',
:lsbdistcodename => 'wheezy',
:architecture => 'amd64',
:id => 'root',
:path => '/foo',
} }

it { should compile.with_all_deps }
end
13 changes: 13 additions & 0 deletions spec/defines/pbuilder_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'spec_helper'
describe 'pbuilder' do
let (:title) { 'foo' }
let (:facts) { {
:osfamily => 'Debian',
:lsbdistcodename => 'wheezy',
:architecture => 'amd64',
:id => 'root',
:path => '/foo',
} }

it { should compile.with_all_deps }
end
1 change: 1 addition & 0 deletions spec/fixtures/manifests/site.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$concat_basedir = '/var/lib/puppet/concat'
9 changes: 9 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'puppetlabs_spec_helper/module_spec_helper'

RSpec.configure do |c|
c.before :each do
if ENV['STRICT_VARIABLES'] == 'yes'
Puppet.settings[:strict_variables]=true
end
end
end