Skip to content

Commit 9b470e1

Browse files
committed
Add tests and support files
1 parent 754f860 commit 9b470e1

File tree

6 files changed

+31
-43
lines changed

6 files changed

+31
-43
lines changed

.fixtures.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fixtures:
2+
repositories:
3+
"puppi": "git://github.com/example42/puppi.git"
4+
"monitor": "git://github.com/example42/puppet-monitor.git"
5+
"firewall": "git://github.com/example42/puppet-firewall.git"
6+
"iptables": "git://github.com/example42/puppet-iptables.git"
7+
"concat": "git://github.com/example42/puppet-concat.git"
8+
symlinks:
9+
"bind": "#{source_dir}"
10+

.gemfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source :rubygems
2+
3+
puppetversion = ENV['PUPPET_VERSION']
4+
gem 'puppet', puppetversion, :require => false
5+
gem 'puppet-lint'
6+
gem 'puppetlabs_spec_helper', '>= 0.1.0'

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/.gradle
2+
/metadata.json
3+
/.rvmrc
4+
build
5+
pkg/
6+
Session.vim
7+
spec/fixtures
8+
.*.sw[a-z]
9+
*.un~

Rakefile

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
require 'rake'
2-
require 'rspec/core/rake_task'
3-
4-
RSpec::Core::RakeTask.new(:test) do |t|
5-
t.rspec_opts = ["--format", "doc", "--color"]
6-
t.pattern = 'spec/*/*_spec.rb'
7-
end
8-
9-
task :default => :test
1+
require 'rubygems'
2+
require 'puppetlabs_spec_helper/rake_tasks'
3+
require 'puppet-lint'
4+
PuppetLint.configuration.send("disable_80chars")
5+
PuppetLint.configuration.send('disable_class_parameter_defaults')

spec/classes/bind_spec.rb

-7
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,6 @@
127127
end
128128
end
129129

130-
describe 'Test service autorestart', :broken => true do
131-
it 'should automatically restart the service, by default' do
132-
content = catalogue.resource('Concat', '/etc/bind/named.conf').send(:parameters)[:notify]
133-
content.should == 'Service[bind]{:name=>"bind"}'
134-
end
135-
end
136-
137130
describe 'Test service autorestart' do
138131
let(:params) { {:service_autorestart => "no" } }
139132

spec/spec_helper.rb

+1-27
Original file line numberDiff line numberDiff line change
@@ -1,27 +1 @@
1-
# Based on https://github.com/puppetlabs/puppetlabs-ntp/blob/master/spec/spec_helper.rb
2-
# Thanks to Ken Barber for advice about http://projects.puppetlabs.com/issues/11191
3-
require 'puppet'
4-
require 'rspec-puppet'
5-
require 'tmpdir'
6-
7-
RSpec.configure do |c|
8-
c.before :each do
9-
# Create a temporary puppet confdir area and temporary site.pp so
10-
# when rspec-puppet runs we don't get a puppet error.
11-
@puppetdir = Dir.mktmpdir("bind")
12-
manifestdir = File.join(@puppetdir, "manifests")
13-
Dir.mkdir(manifestdir)
14-
FileUtils.touch(File.join(manifestdir, "site.pp"))
15-
Puppet[:confdir] = @puppetdir
16-
end
17-
18-
c.filter_run_excluding :broken => true
19-
20-
c.after :each do
21-
if FileTest.exists?("#{@puppetdir}")
22-
FileUtils.remove_entry_secure(@puppetdir)
23-
end
24-
end
25-
26-
c.module_path = File.join(File.dirname(__FILE__), '../../')
27-
end
1+
require 'puppetlabs_spec_helper/module_spec_helper'

0 commit comments

Comments
 (0)