Project

General

Profile

« Previous | Next » 

Revision 5c836c68

Added by Ewoud Kohl van Wijngaarden almost 10 years ago

Add tests

View differences:

.fixtures.yml
fixtures:
repositories:
concat_native: "git://github.com/theforeman/puppet-concat.git"
symlinks:
dhcp: "#{source_dir}"
.gitignore
## MAC OS
.DS_Store
.vagrant
*.swp
*.swo
## TEXTMATE
*.tmproj
tmtags
.bundle
vendor/
## EMACS
*~
\#*
.\#*
pkg/
## VIM
*.swp
tags
Gemfile.lock
pkg/
.rbenv*
.rvmrc*
.ruby-version
spec/fixtures/
.travis.yml
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
env:
- PUPPET_VERSION=2.7.0
- PUPPET_VERSION=3.2.0
- PUPPET_VERSION=3.3
matrix:
exclude:
# No support for Ruby 2.0 before Puppet 3.2
- rvm: 2.0.0
env: PUPPET_VERSION=2.7.0
Gemfile
source 'https://rubygems.org'
if ENV.key?('PUPPET_VERSION')
puppetversion = "~> #{ENV['PUPPET_VERSION']}"
else
puppetversion = ['>= 2.7']
end
gem 'puppet', puppetversion
gem 'puppet-lint', '>=0.3.2'
gem 'puppetlabs_spec_helper', '>=0.2.0'
gem 'rspec-puppet', '>= 1'
Rakefile
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp"]
PuppetLint.configuration.log_format = '%{path}:%{linenumber}:%{KIND}: %{message}'
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send("disable_class_inherits_from_params_class")
PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.send("disable_documentation")
task :default => [:spec, :lint]
spec/classes/init_spec.rb
require 'spec_helper'
describe 'dhcp' do
context 'supported operating systems' do
['Debian', 'RedHat'].each do |osfamily|
describe "dhcp class without any parameters on #{osfamily}" do
let(:params) do {
:interfaces => ['eth0'],
} end
let(:facts) do {
:osfamily => osfamily,
} end
it { should compile.with_all_deps }
end
end
end
end
spec/spec_helper.rb
require 'puppetlabs_spec_helper/module_spec_helper'

Also available in: Unified diff