rspec-system-puppet 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
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', '~>0.3.1'
62
- gem 'puppet-lint', '~> 0.3.2'
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
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  # Metadata
4
4
  s.name = "rspec-system-puppet"
5
- s.version = "1.0.0"
5
+ s.version = "1.0.1"
6
6
  s.authors = ["Ken Barber"]
7
7
  s.email = ["ken@bob.sh"]
8
8
  s.homepage = "https://github.com/kbarber/rspec-system-puppet"
@@ -0,0 +1,6 @@
1
+ class mymodule (
2
+ $param1,
3
+ $param2 = 'foo',
4
+ ) {
5
+ notice("Param1: ${param1} Param2: ${param2}")
6
+ }
@@ -1,6 +1,10 @@
1
1
  require 'rspec-system/spec_helper'
2
2
  require 'rspec-system-puppet/helpers'
3
3
 
4
+ def proj_root
5
+ Pathname.new(File.join(File.dirname(__FILE__), '..'))
6
+ end
7
+
4
8
  RSpec.configure do |c|
5
9
  c.include RSpecSystemPuppet::Helpers
6
10
  end
@@ -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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.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-21 00:00:00 Z
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