rspec-system-puppet 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +8 -2
- data/lib/rspec-system-puppet/helpers.rb +14 -0
- data/rspec-system-puppet.gemspec +1 -1
- data/spec/fixtures/mymodule/manifests/init.pp +6 -0
- data/spec/spec_helper_system.rb +4 -0
- data/spec/system/basic_spec.rb +17 -0
- metadata +5 -4
data/README.md
CHANGED
@@ -58,8 +58,8 @@ Make sure you have a `Gemfile` like the one below, this includes `rspec-puppet`
|
|
58
58
|
group :development, :test do
|
59
59
|
gem 'rake'
|
60
60
|
gem 'puppetlabs_spec_helper', :require => false
|
61
|
-
gem 'rspec-system-puppet'
|
62
|
-
gem 'puppet-lint'
|
61
|
+
gem 'rspec-system-puppet'
|
62
|
+
gem 'puppet-lint'
|
63
63
|
end
|
64
64
|
|
65
65
|
if puppetversion = ENV['PUPPET_GEM_VERSION']
|
@@ -151,6 +151,12 @@ Then grab the gemset bundle:
|
|
151
151
|
Now you should be able to do:
|
152
152
|
|
153
153
|
# rake spec:system
|
154
|
+
|
155
|
+
If you want to test an alternate set, just use the RSPEC_SET environment variable like so:
|
156
|
+
|
157
|
+
# RSPEC_SET=debian-70rc1-x64 rake spec:system
|
158
|
+
|
159
|
+
Consult the .nodeset.yml file for the list of sets.
|
154
160
|
|
155
161
|
## Further Information
|
156
162
|
|
@@ -43,12 +43,26 @@ module RSpecSystemPuppet::Helpers
|
|
43
43
|
log.info("Preparing modules dir")
|
44
44
|
system_run('mkdir -p /etc/puppet/modules')
|
45
45
|
|
46
|
+
# Create alias for puppet
|
46
47
|
pp = <<-EOS
|
47
48
|
host { 'puppet':
|
48
49
|
ip => '127.0.0.1',
|
49
50
|
}
|
50
51
|
EOS
|
51
52
|
puppet_apply(pp)
|
53
|
+
|
54
|
+
# Create hiera.yaml
|
55
|
+
file = Tempfile.new('hierayaml')
|
56
|
+
begin
|
57
|
+
file.write(<<-EOS)
|
58
|
+
---
|
59
|
+
:logger: noop
|
60
|
+
EOS
|
61
|
+
file.close
|
62
|
+
system_rcp(:sp => file.path, :dp => '/etc/puppet/hiera.yaml')
|
63
|
+
ensure
|
64
|
+
file.unlink
|
65
|
+
end
|
52
66
|
end
|
53
67
|
|
54
68
|
# Basic helper to install a puppet master
|
data/rspec-system-puppet.gemspec
CHANGED
data/spec/spec_helper_system.rb
CHANGED
data/spec/system/basic_spec.rb
CHANGED
@@ -68,4 +68,21 @@ describe "basic tests:" do
|
|
68
68
|
r[:exit_code].should == 0
|
69
69
|
end
|
70
70
|
end
|
71
|
+
|
72
|
+
it 'check for no errors when including a class' do
|
73
|
+
puppet_module_install(
|
74
|
+
:source => proj_root + 'spec' + 'fixtures' + 'mymodule',
|
75
|
+
:module_name => 'mymodule'
|
76
|
+
)
|
77
|
+
pp = <<-EOS.gsub(/^\s{6}/, '')
|
78
|
+
class { 'mymodule':
|
79
|
+
param1 => 'bar',
|
80
|
+
}
|
81
|
+
EOS
|
82
|
+
puppet_apply(pp) do |r|
|
83
|
+
r[:stdout].should =~ /Param1: bar/
|
84
|
+
r[:stderr].should == ''
|
85
|
+
r[:exit_code].should == 0
|
86
|
+
end
|
87
|
+
end
|
71
88
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-system-puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ken Barber
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-04-
|
18
|
+
date: 2013-04-24 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rspec-system
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- lib/rspec-system-puppet.rb
|
54
54
|
- lib/rspec-system-puppet/helpers.rb
|
55
55
|
- rspec-system-puppet.gemspec
|
56
|
+
- spec/fixtures/mymodule/manifests/init.pp
|
56
57
|
- spec/spec_helper.rb
|
57
58
|
- spec/spec_helper_system.rb
|
58
59
|
- spec/system/basic_spec.rb
|