hiera-puppet-helper 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.fixtures.yml +3 -0
- data/.gitignore +1 -0
- data/.travis.yml +27 -0
- data/Gemfile +16 -2
- data/README.md +7 -5
- data/Rakefile +3 -1
- data/example/hieradata/example.yaml +1 -0
- data/example/manifests/bar.pp +3 -0
- data/example/manifests/foo.pp +3 -0
- data/hiera-puppet-helper.gemspec +2 -8
- data/lib/hiera-puppet-helper/rspec.rb +0 -1
- data/lib/hiera-puppet-helper/version.rb +2 -6
- data/spec/classes/bar_spec.rb +11 -0
- data/spec/classes/foo_spec.rb +16 -0
- data/spec/spec_helper.rb +2 -0
- metadata +22 -57
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
SHA512:
|
3
|
-
metadata.gz: 6865edd07321653bcbd6d79820e025cb123ad18990468c1d28057df1886b2aa9e1430ee695c0e9bb6b10ac3049915de58c48f9ce248225d1c25fd3c5e2b32f2e
|
4
|
-
data.tar.gz: cd834a8a545bced7409efa40f624acdd959a51b8d42c14ebcc53870b01c24587de1cf8eda807ab633dd38653889ed2c332c839a6e7488a963e986eac39637568
|
5
2
|
SHA1:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17dadcc0ec2fc053b6e5a7eea27f10b0b4fba466
|
4
|
+
data.tar.gz: c54c772dc9eb4fd1b264774819ad7c7b7e985ce1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 280f3445a33a4b8e241a235543c8b1b5704b50149b5f214b65a82fa2fdcb0f7f4d54b0562a3a40fd608dd027a6fea86bb068e822195e6910eb22ad1ea6c469ef
|
7
|
+
data.tar.gz: 8dfc2c4663ccc22a367c26ea94c8aea12c04b3257254ecce6f69fd200f9adab01a9b9dc6c0a9bfc3b3e3e39f3341c6575e9f248866f145918b7a89aac738895c
|
data/.fixtures.yml
ADDED
data/.gitignore
CHANGED
data/.travis.yml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
language: ruby
|
2
|
+
bundler_args: --without development
|
3
|
+
script: "bundle exec rake spec SPEC_OPTS='--format documentation'"
|
4
|
+
rvm:
|
5
|
+
- 1.8.7
|
6
|
+
- 1.9.3
|
7
|
+
- ree
|
8
|
+
- ruby-head
|
9
|
+
env:
|
10
|
+
- PUPPET_GEM_VERSION="~> 2.6.0"
|
11
|
+
- PUPPET_GEM_VERSION="~> 2.7.0"
|
12
|
+
- PUPPET_GEM_VERSION="~> 3.0.0"
|
13
|
+
- PUPPET_GEM_VERSION="~> 3.1.0"
|
14
|
+
matrix:
|
15
|
+
allow_failures:
|
16
|
+
- rvm: ruby-head
|
17
|
+
exclude:
|
18
|
+
- rvm: 1.9.3
|
19
|
+
env: PUPPET_GEM_VERSION="~> 2.7.0"
|
20
|
+
- rvm: ruby-head
|
21
|
+
env: PUPPET_GEM_VERSION="~> 2.7.0"
|
22
|
+
- rvm: 1.9.3
|
23
|
+
env: PUPPET_GEM_VERSION="~> 2.6.0"
|
24
|
+
- rvm: ruby-head
|
25
|
+
env: PUPPET_GEM_VERSION="~> 2.6.0"
|
26
|
+
notifications:
|
27
|
+
email: false
|
data/Gemfile
CHANGED
@@ -1,4 +1,18 @@
|
|
1
|
-
source
|
1
|
+
source :rubygems
|
2
2
|
|
3
|
-
# Specify your gem's dependencies in rspec-hiera-puppet.gemspec
|
4
3
|
gemspec
|
4
|
+
|
5
|
+
group :development, :test do
|
6
|
+
gem 'puppetlabs_spec_helper', :require => false
|
7
|
+
gem 'rspec'
|
8
|
+
gem 'rspec-puppet'
|
9
|
+
end
|
10
|
+
|
11
|
+
if puppetversion = ENV['PUPPET_GEM_VERSION']
|
12
|
+
gem 'puppet', puppetversion, :require => false
|
13
|
+
else
|
14
|
+
gem 'puppet', :require => false
|
15
|
+
end
|
16
|
+
|
17
|
+
gem 'hiera'
|
18
|
+
gem 'hiera-puppet', '>= 1.0'
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# Hiera::Puppet::Helper
|
2
2
|
|
3
3
|
Hiera fixtures for puppet-rspec tests.
|
4
4
|
|
@@ -6,7 +6,7 @@ Hiera fixtures for puppet-rspec tests.
|
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
-
gem '
|
9
|
+
gem 'hiera-puppet-helper'
|
10
10
|
|
11
11
|
And then execute:
|
12
12
|
|
@@ -14,10 +14,12 @@ And then execute:
|
|
14
14
|
|
15
15
|
Or install it yourself as:
|
16
16
|
|
17
|
-
$ gem install
|
17
|
+
$ gem install hiera-puppet-helper
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
+
Note: you can find a working example inside the example/ directory of this gem.
|
22
|
+
|
21
23
|
### Basic
|
22
24
|
|
23
25
|
The following assumes that you are already be familiar with
|
@@ -25,7 +27,7 @@ The following assumes that you are already be familiar with
|
|
25
27
|
|
26
28
|
To use this gem add the following include to spec/spec\_helper.rb:
|
27
29
|
|
28
|
-
require '
|
30
|
+
require 'hiera-puppet-helper'
|
29
31
|
|
30
32
|
For the purpose of demonstrating a Hiera fixture, lets assume there is the
|
31
33
|
following contrived example of a Puppet class:
|
@@ -106,7 +108,7 @@ demonstrates the use of a shared context.
|
|
106
108
|
|
107
109
|
_spec/spec\_helper.rb_
|
108
110
|
|
109
|
-
require '
|
111
|
+
require 'hiera-puppet-helper'
|
110
112
|
|
111
113
|
fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
|
112
114
|
|
data/Rakefile
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
foo_message: "bar"
|
data/hiera-puppet-helper.gemspec
CHANGED
@@ -6,18 +6,12 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.email = ["mthibaut@cisco.com"]
|
7
7
|
gem.description = %q{Hiera fixtures for rspec-puppet tests.}
|
8
8
|
gem.summary = %q{Hiera fixtures for rspec-puppet tests.}
|
9
|
-
gem.homepage = "https://github.com/mthibaut/
|
9
|
+
gem.homepage = "https://github.com/mthibaut/hiera-puppet-helper"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
14
|
gem.name = "hiera-puppet-helper"
|
15
15
|
gem.require_paths = ["lib"]
|
16
|
-
gem.version =
|
17
|
-
|
18
|
-
gem.add_dependency('puppet', '>= 3.0')
|
19
|
-
gem.add_dependency('hiera', '>= 1.0')
|
20
|
-
gem.add_dependency('hiera-puppet', '>= 1.0')
|
21
|
-
gem.add_dependency('rspec')
|
22
|
-
gem.add_dependency('rspec-puppet')
|
16
|
+
gem.version = HieraPuppetHelper::VERSION
|
23
17
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "example::foo" do
|
4
|
+
|
5
|
+
describe "file-based hiera test" do
|
6
|
+
describe 'should contain_notify("foo").with_message("bar")' do
|
7
|
+
let(:hiera_config) do
|
8
|
+
{ :backends => ['yaml'],
|
9
|
+
:hierarchy => ['example'],
|
10
|
+
:yaml => {
|
11
|
+
:datadir => File.expand_path(File.join(__FILE__, '..', '..', 'fixtures', 'modules', 'example', 'hieradata')) }}
|
12
|
+
end
|
13
|
+
it { should contain_notify("foo").with_message("bar") }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hiera-puppet-helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maarten Thibaut
|
@@ -9,57 +9,9 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2013-04-
|
13
|
-
dependencies:
|
14
|
-
|
15
|
-
name: puppet
|
16
|
-
prerelease: false
|
17
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
18
|
-
requirements:
|
19
|
-
- - ">="
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: "3.0"
|
22
|
-
type: :runtime
|
23
|
-
version_requirements: *id001
|
24
|
-
- !ruby/object:Gem::Dependency
|
25
|
-
name: hiera
|
26
|
-
prerelease: false
|
27
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
28
|
-
requirements:
|
29
|
-
- - ">="
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version: "1.0"
|
32
|
-
type: :runtime
|
33
|
-
version_requirements: *id002
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: hiera-puppet
|
36
|
-
prerelease: false
|
37
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: "1.0"
|
42
|
-
type: :runtime
|
43
|
-
version_requirements: *id003
|
44
|
-
- !ruby/object:Gem::Dependency
|
45
|
-
name: rspec
|
46
|
-
prerelease: false
|
47
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
48
|
-
requirements:
|
49
|
-
- &id005
|
50
|
-
- ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: "0"
|
53
|
-
type: :runtime
|
54
|
-
version_requirements: *id004
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rspec-puppet
|
57
|
-
prerelease: false
|
58
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- *id005
|
61
|
-
type: :runtime
|
62
|
-
version_requirements: *id006
|
12
|
+
date: 2013-04-15 00:00:00 Z
|
13
|
+
dependencies: []
|
14
|
+
|
63
15
|
description: Hiera fixtures for rspec-puppet tests.
|
64
16
|
email:
|
65
17
|
- mthibaut@cisco.com
|
@@ -70,18 +22,26 @@ extensions: []
|
|
70
22
|
extra_rdoc_files: []
|
71
23
|
|
72
24
|
files:
|
25
|
+
- .fixtures.yml
|
73
26
|
- .gitignore
|
27
|
+
- .travis.yml
|
74
28
|
- Gemfile
|
75
29
|
- LICENSE
|
76
30
|
- README.md
|
77
31
|
- Rakefile
|
32
|
+
- example/hieradata/example.yaml
|
33
|
+
- example/manifests/bar.pp
|
34
|
+
- example/manifests/foo.pp
|
78
35
|
- hiera-puppet-helper.gemspec
|
79
36
|
- lib/hiera-puppet-helper.rb
|
80
37
|
- lib/hiera-puppet-helper/puppet.rb
|
81
38
|
- lib/hiera-puppet-helper/rspec.rb
|
82
39
|
- lib/hiera-puppet-helper/version.rb
|
83
40
|
- lib/hiera/backend/rspec_backend.rb
|
84
|
-
|
41
|
+
- spec/classes/bar_spec.rb
|
42
|
+
- spec/classes/foo_spec.rb
|
43
|
+
- spec/spec_helper.rb
|
44
|
+
homepage: https://github.com/mthibaut/hiera-puppet-helper
|
85
45
|
licenses: []
|
86
46
|
|
87
47
|
metadata: {}
|
@@ -93,10 +53,13 @@ require_paths:
|
|
93
53
|
- lib
|
94
54
|
required_ruby_version: !ruby/object:Gem::Requirement
|
95
55
|
requirements:
|
96
|
-
-
|
56
|
+
- &id001
|
57
|
+
- ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: "0"
|
97
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
61
|
requirements:
|
99
|
-
- *
|
62
|
+
- *id001
|
100
63
|
requirements: []
|
101
64
|
|
102
65
|
rubyforge_project:
|
@@ -104,5 +67,7 @@ rubygems_version: 2.0.3
|
|
104
67
|
signing_key:
|
105
68
|
specification_version: 4
|
106
69
|
summary: Hiera fixtures for rspec-puppet tests.
|
107
|
-
test_files:
|
108
|
-
|
70
|
+
test_files:
|
71
|
+
- spec/classes/bar_spec.rb
|
72
|
+
- spec/classes/foo_spec.rb
|
73
|
+
- spec/spec_helper.rb
|