enable basic testing

adds the first unit test and the required peripheral config files for
rspec-puppet.
This commit is contained in:
Dan Bode 2013-04-19 14:34:05 -07:00
parent 9ef62597c8
commit 75d0fbe037
6 changed files with 48 additions and 0 deletions

3
.fixtures.yml Normal file
View File

@ -0,0 +1,3 @@
fixtures:
symlinks:
"vswitch": "#{source_dir}"

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.swp
spec/fixtures/modules/*
spec/fixtures/manifests/*

13
Puppetfile Normal file
View File

@ -0,0 +1,13 @@
source :rubygems
group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
end
if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end
# vim:ft=ruby

1
Rakefile Normal file
View File

@ -0,0 +1 @@
require 'puppetlabs_spec_helper/rake_tasks'

View File

@ -0,0 +1,27 @@
require 'spec_helper'
describe 'vswitch::ovs' do
context 'on redhat with default parameters' do
let :facts do
{:osfamily => 'Redhat'}
end
it 'should contain the correct package and service' do
should contain_service('openvswitch').with(
:ensure => true,
:enable => true,
:name => 'openvswitch'
)
should contain_package('openvswitch').with(
:name => 'openvswitch',
:ensure => 'present',
:before => 'Service[openvswitch]'
)
end
end
end

1
spec/spec_helper.rb Normal file
View File

@ -0,0 +1 @@
require 'puppetlabs_spec_helper/module_spec_helper'