cucumber-puppet 0.2.0 → 0.3.0
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/VERSION.yml +1 -1
- data/lib/cucumber-puppet/puppet.rb +9 -9
- data/lib/generators/world/support/hooks.rb +5 -3
- data/man/cucumber-puppet-gen.1 +10 -16
- data/man/cucumber-puppet.1 +35 -52
- metadata +21 -10
data/VERSION.yml
CHANGED
@@ -9,8 +9,11 @@ class CucumberPuppet
|
|
9
9
|
# resources' alias metaparameter
|
10
10
|
@aliases = {}
|
11
11
|
|
12
|
-
|
13
|
-
@
|
12
|
+
# default puppet configuration
|
13
|
+
@puppetcfg = {
|
14
|
+
'confdir' => "/etc/puppet",
|
15
|
+
'manifest' => "/etc/puppet/manifests/site.pp",
|
16
|
+
}
|
14
17
|
|
15
18
|
# default facts
|
16
19
|
@facts = {
|
@@ -45,16 +48,13 @@ class CucumberPuppet
|
|
45
48
|
end
|
46
49
|
|
47
50
|
# Compile catalog for configured testnode.
|
48
|
-
#
|
49
|
-
# @confdir defaults to '/etc/puppet'
|
50
|
-
# @manifest defaults to @confdir + '/manifests/site.pp'
|
51
|
-
#
|
52
51
|
def compile_catalog( node = nil )
|
53
|
-
Puppet.settings.handlearg("--confdir", @confdir)
|
52
|
+
Puppet.settings.handlearg("--confdir", @puppetcfg['confdir'])
|
54
53
|
Puppet.parse_config
|
55
54
|
# reset confdir in case it got overwritten
|
56
|
-
|
57
|
-
|
55
|
+
@puppetcfg.each do |option,value|
|
56
|
+
Puppet.settings.handlearg("--#{option}", value)
|
57
|
+
end
|
58
58
|
|
59
59
|
unless node.is_a?(Puppet::Node)
|
60
60
|
node = Puppet::Node.new(@facts['hostname'], :classes => @klass)
|
@@ -1,7 +1,9 @@
|
|
1
1
|
Before do
|
2
|
-
# local configuration
|
3
|
-
# @confdir
|
4
|
-
# @manifest = File.join(@confdir, 'manifests', 'site.pp')
|
2
|
+
# adjust local configuration like this
|
3
|
+
# @puppetcfg['confdir'] = File.join(File.dirname(__FILE__), '..', '..')
|
4
|
+
# @puppetcfg['manifest'] = File.join(@puppetcfg['confdir'], 'manifests', 'site.pp')
|
5
|
+
# @puppetcfg['modulepath'] = "/srv/puppet/modules:/srv/puppet/site-modules"
|
6
|
+
|
5
7
|
# adjust facts like this
|
6
8
|
@facts['architecture'] = "i386"
|
7
9
|
end
|
data/man/cucumber-puppet-gen.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" generated with Ronn/v0.
|
2
|
-
.\" http://github.com/rtomayko/ronn/
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
4
|
.TH "CUCUMBER\-PUPPET\-GEN" "1" "September 2010" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
|
-
\fBcucumber\-puppet\-gen\fR
|
7
|
+
\fBcucumber\-puppet\-gen\fR \- Generator script for cucumber\-puppet
|
8
8
|
.
|
9
9
|
.SH "SYNOPSIS"
|
10
10
|
\fBcucumber\-puppet\-gen\fR feature MODULE FEATURE
|
@@ -13,19 +13,15 @@
|
|
13
13
|
\fBcucumber\-puppet\-gen\fR world
|
14
14
|
.
|
15
15
|
.SH "DESCRIPTION"
|
16
|
-
\fBcucumber\-puppet\-gen\fR generates feature files and initializes a Puppet tree
|
17
|
-
for use with \fBcucumber\-puppet\fR.
|
16
|
+
\fBcucumber\-puppet\-gen\fR generates feature files and initializes a Puppet tree for use with \fBcucumber\-puppet\fR\.
|
18
17
|
.
|
19
18
|
.TP
|
20
19
|
\fBcucumber\-puppet\-gen\fR feature MODULE FEATURE
|
21
|
-
Generate a feature file from template for feature FEATURE and module
|
22
|
-
MODULE. Depending on the current working directory, the feature is either
|
23
|
-
placed in \fBfeatures/modules/MODULE/FEATURE.feature\fR or, if called from the \fBmodules/\fR subdirectory tree, \fBmodules/MODULE/features/FEATURE.feature\fR.
|
20
|
+
Generate a feature file from template for feature FEATURE and module MODULE\. Depending on the current working directory, the feature is either placed in \fBfeatures/modules/MODULE/FEATURE\.feature\fR or, if called from the \fBmodules/\fR subdirectory tree, \fBmodules/MODULE/features/FEATURE\.feature\fR\.
|
24
21
|
.
|
25
22
|
.TP
|
26
23
|
\fBcucumber\-puppet\-gen\fR world
|
27
|
-
Initialize Puppet tree for use with \fBcucumber\-puppet\fR, to be run from the
|
28
|
-
Puppet tree's root.
|
24
|
+
Initialize Puppet tree for use with \fBcucumber\-puppet\fR, to be run from the Puppet tree\'s root\.
|
29
25
|
.
|
30
26
|
.SH "EXAMPLES"
|
31
27
|
Initialize the Puppet tree:
|
@@ -42,10 +38,10 @@ $ cucumber\-puppet\-gen world
|
|
42
38
|
.IP "" 0
|
43
39
|
.
|
44
40
|
.P
|
45
|
-
Generated files are to be found in \fBfeatures/steps/\fR and \fBfeatures/support/\fR
|
41
|
+
Generated files are to be found in \fBfeatures/steps/\fR and \fBfeatures/support/\fR\.
|
46
42
|
.
|
47
43
|
.P
|
48
|
-
Create a feature file for module \fIfoo\fR's \fIbar\fR feature:
|
44
|
+
Create a feature file for module \fIfoo\fR\'s \fIbar\fR feature:
|
49
45
|
.
|
50
46
|
.IP "" 4
|
51
47
|
.
|
@@ -73,12 +69,10 @@ $ cucumber\-puppet\-gen feature foo bar
|
|
73
69
|
.IP "" 0
|
74
70
|
.
|
75
71
|
.SH "REPORTING BUGS"
|
76
|
-
Please report any bugs at
|
77
|
-
http://projects.puppetlabs.com/projects/cucumber\-puppet/issues/new
|
78
|
-
or send an email to \fIcucumber-puppet@erisiandiscord.de\fR.
|
72
|
+
Please report any bugs at http://projects\.puppetlabs\.com/projects/cucumber\-puppet/issues/new or send an email to \fIcucumber\-puppet@erisiandiscord\.de\fR\.
|
79
73
|
.
|
80
74
|
.SH "COPYRIGHT"
|
81
|
-
\fBcucumber\-puppet\fR is Copyright (c) 2010 Nikolay Sturm \fIsturm@nistu
|
75
|
+
\fBcucumber\-puppet\fR is Copyright (c) 2010 Nikolay Sturm \fIsturm@nistu\.de\fR
|
82
76
|
.
|
83
77
|
.SH "SEE ALSO"
|
84
78
|
cucumber\-puppet(1)
|
data/man/cucumber-puppet.1
CHANGED
@@ -1,107 +1,96 @@
|
|
1
|
-
.\" generated with Ronn/v0.
|
2
|
-
.\" http://github.com/rtomayko/ronn/
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
4
|
.TH "CUCUMBER\-PUPPET" "1" "September 2010" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
|
-
\fBcucumber\-puppet\fR
|
7
|
+
\fBcucumber\-puppet\fR \- Puppet catalog testing with Cucumber
|
8
8
|
.
|
9
9
|
.SH "SYNOPSIS"
|
10
|
-
\fBcucumber\-puppet\fR [ OPTIONS ] FILE | DIR
|
10
|
+
\fBcucumber\-puppet\fR [ OPTIONS ] FILE | DIR \.\.\.
|
11
11
|
.
|
12
12
|
.SH "DESCRIPTION"
|
13
|
-
\fBcucumber\-puppet\fR is a tool for behavioral testing of Puppet catalogs
|
14
|
-
provides the glue necessary to access Puppet's data structures from Cucumber's
|
15
|
-
step definitions.
|
13
|
+
\fBcucumber\-puppet\fR is a tool for behavioral testing of Puppet catalogs\. It provides the glue necessary to access Puppet\'s data structures from Cucumber\'s step definitions\.
|
16
14
|
.
|
17
15
|
.P
|
18
|
-
\fBcucumber\-puppet\fR takes a list of feature files or directories, containing
|
19
|
-
feature files, as argument. These will then be run through \fBcucumber\fR. It needs
|
20
|
-
to be started from somewhere inside the Puppet directory tree.
|
16
|
+
\fBcucumber\-puppet\fR takes a list of feature files or directories, containing feature files, as argument\. These will then be run through \fBcucumber\fR\. It needs to be started from somewhere inside the Puppet directory tree\.
|
21
17
|
.
|
22
18
|
.TP
|
23
19
|
\fB\-h\fR, \fB\-\-help\fR
|
24
|
-
Show help message
|
20
|
+
Show help message\.
|
25
21
|
.
|
26
22
|
.TP
|
27
23
|
\fB\-\-version\fR
|
28
|
-
Show version number
|
24
|
+
Show version number\.
|
29
25
|
.
|
30
26
|
.P
|
31
|
-
The following options are passed on to \fBcucumber\fR
|
32
|
-
further details.
|
27
|
+
The following options are passed on to \fBcucumber\fR\. See \fBcucumber \-\-help\fR for further details\.
|
33
28
|
.
|
34
29
|
.TP
|
35
30
|
\fB\-b\fR, \fB\-\-backtrace\fR
|
36
|
-
Show full backtrace for all errors
|
31
|
+
Show full backtrace for all errors\.
|
37
32
|
.
|
38
33
|
.TP
|
39
34
|
\fB\-e\fR, \fB\-\-exclude\fR \fIPATTERN\fR
|
40
|
-
Don't run feature files or require ruby files matching \fIPATTERN\fR
|
35
|
+
Don\'t run feature files or require ruby files matching \fIPATTERN\fR\.
|
41
36
|
.
|
42
37
|
.TP
|
43
38
|
\fB\-f\fR, \fB\-\-format\fR \fIFORMAT\fR
|
44
|
-
How to format features (Default: pretty)
|
39
|
+
How to format features (Default: pretty)\.
|
45
40
|
.
|
46
41
|
.TP
|
47
42
|
\fB\-n\fR, \fB\-\-name\fR \fINAME\fR
|
48
|
-
Only run matching feature elements
|
43
|
+
Only run matching feature elements\.
|
49
44
|
.
|
50
45
|
.TP
|
51
46
|
\fB\-o\fR, \fB\-\-out\fR \fIFILE\fR|\fIDIR\fR
|
52
|
-
Write output to \fIFILE\fR|\fIDIR\fR
|
47
|
+
Write output to \fIFILE\fR|\fIDIR\fR\.
|
53
48
|
.
|
54
49
|
.TP
|
55
50
|
\fB\-t\fR, \fB\-\-tags\fR \fITAG\-EXPRESSION\fR
|
56
|
-
Only run features/scenarios matching \fITAG\-EXPRESSION\fR
|
51
|
+
Only run features/scenarios matching \fITAG\-EXPRESSION\fR\.
|
57
52
|
.
|
58
53
|
.TP
|
59
54
|
\fB\-v\fR, \fB\-\-verbose\fR
|
60
|
-
Show files and features loaded
|
55
|
+
Show files and features loaded\.
|
61
56
|
.
|
62
57
|
.TP
|
63
58
|
\fB\-x\fR, \fB\-\-expand\fR
|
64
|
-
Expand Scenario Outline Tables in output
|
59
|
+
Expand Scenario Outline Tables in output\.
|
65
60
|
.
|
66
61
|
.SH "FILES"
|
67
|
-
\fBcucumber\-puppet\fR assumes a certain directory structure to magically find
|
68
|
-
necessary support files. Relative to the Puppet directory's root, the structure
|
69
|
-
looks like this:
|
62
|
+
\fBcucumber\-puppet\fR assumes a certain directory structure to magically find necessary support files\. Relative to the Puppet directory\'s root, the structure looks like this:
|
70
63
|
.
|
71
64
|
.TP
|
72
65
|
\fBfeatures/\fR
|
73
|
-
The generic place to store Cucumber files
|
66
|
+
The generic place to store Cucumber files\.
|
74
67
|
.
|
75
68
|
.TP
|
76
69
|
\fBfeatures/modules/foo/\fR
|
77
|
-
Feature files for module \fIfoo\fR go here
|
70
|
+
Feature files for module \fIfoo\fR go here\.
|
78
71
|
.
|
79
72
|
.TP
|
80
|
-
\fBfeatures/modules/foo/bar
|
81
|
-
File containing scenarios for the \fIbar\fR feature
|
73
|
+
\fBfeatures/modules/foo/bar\.feature\fR
|
74
|
+
File containing scenarios for the \fIbar\fR feature\.
|
82
75
|
.
|
83
76
|
.TP
|
84
77
|
\fBfeatures/steps/\fR
|
85
|
-
Step definitions go here
|
86
|
-
putting these into files named \fBmodule_foo.rb\fR or \fBdefine_bar.rb\fR. Although
|
87
|
-
names don't really matter to cucumber, as long as files have the proper
|
88
|
-
suffix.
|
78
|
+
Step definitions go here\. To distinguish local extensions, it is suggested putting these into files named \fBmodule_foo\.rb\fR or \fBdefine_bar\.rb\fR\. Although names don\'t really matter to cucumber, as long as files have the proper suffix\.
|
89
79
|
.
|
90
80
|
.TP
|
91
81
|
\fBfeatures/support/\fR
|
92
|
-
Cucumber support files go here
|
82
|
+
Cucumber support files go here\.
|
93
83
|
.
|
94
84
|
.P
|
95
|
-
\fBcucumber\-puppet\fR also supports bundling features with modules
|
96
|
-
looks for features, step definitions and support files in \fBmodules/foo/features/\fR like so:
|
85
|
+
\fBcucumber\-puppet\fR also supports bundling features with modules\. In this case it looks for features, step definitions and support files in \fBmodules/foo/features/\fR like so:
|
97
86
|
.
|
98
87
|
.TP
|
99
|
-
\fBmodules/foo/features/bar
|
100
|
-
Bundled feature file
|
88
|
+
\fBmodules/foo/features/bar\.feature\fR
|
89
|
+
Bundled feature file\.
|
101
90
|
.
|
102
91
|
.TP
|
103
|
-
\fBmodules/foo/features/steps/bar
|
104
|
-
Bundled step definition file
|
92
|
+
\fBmodules/foo/features/steps/bar\.rb\fR
|
93
|
+
Bundled step definition file\.
|
105
94
|
.
|
106
95
|
.SH "EXAMPLES"
|
107
96
|
To run all features found in a directory:
|
@@ -123,32 +112,26 @@ To run a single feature:
|
|
123
112
|
.
|
124
113
|
.nf
|
125
114
|
|
126
|
-
$ cucumber\-puppet features/modules/foo/bar
|
115
|
+
$ cucumber\-puppet features/modules/foo/bar\.feature
|
127
116
|
.
|
128
117
|
.fi
|
129
118
|
.
|
130
119
|
.IP "" 0
|
131
120
|
.
|
132
121
|
.SH "REPORTING BUGS"
|
133
|
-
Please report any bugs at
|
134
|
-
http://projects.puppetlabs.com/projects/cucumber\-puppet/issues/new
|
135
|
-
or send an email to \fIcucumber-puppet@erisiandiscord.de\fR.
|
122
|
+
Please report any bugs at http://projects\.puppetlabs\.com/projects/cucumber\-puppet/issues/new or send an email to \fIcucumber\-puppet@erisiandiscord\.de\fR\.
|
136
123
|
.
|
137
124
|
.SH "COPYRIGHT"
|
138
|
-
\fBcucumber\-puppet\fR is Copyright (c) 2010 Nikolay Sturm \fIsturm@nistu
|
125
|
+
\fBcucumber\-puppet\fR is Copyright (c) 2010 Nikolay Sturm \fIsturm@nistu\.de\fR
|
139
126
|
.
|
140
127
|
.SH "SEE ALSO"
|
141
128
|
cucumber\-puppet\-gen(1)
|
142
129
|
.
|
143
130
|
.P
|
144
|
-
Behavior Driven Development:
|
145
|
-
http://behaviour\-driven.org/
|
146
|
-
http://en.wikipedia.org/wiki/Behavior_driven_development
|
131
|
+
Behavior Driven Development: http://behaviour\-driven\.org/ http://en\.wikipedia\.org/wiki/Behavior_driven_development
|
147
132
|
.
|
148
133
|
.P
|
149
|
-
Cucumber:
|
150
|
-
http://cukes.info/
|
134
|
+
Cucumber: http://cukes\.info/
|
151
135
|
.
|
152
136
|
.P
|
153
|
-
Puppet:
|
154
|
-
http://www.puppetlabs.com/puppet/introduction/
|
137
|
+
Puppet: http://www\.puppetlabs\.com/puppet/introduction/
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 19
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
|
-
-
|
8
|
+
- 3
|
8
9
|
- 0
|
9
|
-
version: 0.
|
10
|
+
version: 0.3.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Nikolay Sturm
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2011-
|
18
|
+
date: 2011-05-09 00:00:00 +02:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: cucumber
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 15
|
27
30
|
segments:
|
28
31
|
- 0
|
29
32
|
- 6
|
@@ -35,9 +38,11 @@ dependencies:
|
|
35
38
|
name: gem-man
|
36
39
|
prerelease: false
|
37
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
38
42
|
requirements:
|
39
43
|
- - ">="
|
40
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 23
|
41
46
|
segments:
|
42
47
|
- 0
|
43
48
|
- 2
|
@@ -49,9 +54,11 @@ dependencies:
|
|
49
54
|
name: templater
|
50
55
|
prerelease: false
|
51
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
52
58
|
requirements:
|
53
59
|
- - ">="
|
54
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 15
|
55
62
|
segments:
|
56
63
|
- 1
|
57
64
|
- 0
|
@@ -80,15 +87,15 @@ files:
|
|
80
87
|
- man/cucumber-puppet.1
|
81
88
|
- man/cucumber-puppet-gen.1
|
82
89
|
- VERSION.yml
|
83
|
-
- lib/generators/world/support/world.rb
|
84
|
-
- lib/generators/world/support/hooks.rb
|
85
|
-
- lib/generators/world/steps/user.rb
|
86
|
-
- lib/generators/world/steps/puppet.rb
|
87
|
-
- lib/generators/world/steps/cron.rb
|
88
|
-
- lib/generators/world/steps/service.rb
|
89
90
|
- lib/generators/world/steps/package.rb
|
90
91
|
- lib/generators/world/steps/exec.rb
|
92
|
+
- lib/generators/world/steps/user.rb
|
91
93
|
- lib/generators/world/steps/file.rb
|
94
|
+
- lib/generators/world/steps/cron.rb
|
95
|
+
- lib/generators/world/steps/puppet.rb
|
96
|
+
- lib/generators/world/steps/service.rb
|
97
|
+
- lib/generators/world/support/hooks.rb
|
98
|
+
- lib/generators/world/support/world.rb
|
92
99
|
has_rdoc: true
|
93
100
|
homepage: http://projects.puppetlabs.com/projects/cucumber-puppet
|
94
101
|
licenses: []
|
@@ -99,23 +106,27 @@ rdoc_options: []
|
|
99
106
|
require_paths:
|
100
107
|
- lib
|
101
108
|
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
102
110
|
requirements:
|
103
111
|
- - ">="
|
104
112
|
- !ruby/object:Gem::Version
|
113
|
+
hash: 3
|
105
114
|
segments:
|
106
115
|
- 0
|
107
116
|
version: "0"
|
108
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
109
119
|
requirements:
|
110
120
|
- - ">="
|
111
121
|
- !ruby/object:Gem::Version
|
122
|
+
hash: 3
|
112
123
|
segments:
|
113
124
|
- 0
|
114
125
|
version: "0"
|
115
126
|
requirements: []
|
116
127
|
|
117
128
|
rubyforge_project:
|
118
|
-
rubygems_version: 1.3.
|
129
|
+
rubygems_version: 1.3.7
|
119
130
|
signing_key:
|
120
131
|
specification_version: 3
|
121
132
|
summary: Puppet catalog testing with Cucumber
|