cucumber-puppet 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :build:
3
- :patch: 0
3
+ :patch: 1
4
4
  :minor: 1
5
5
  :major: 0
@@ -6,6 +6,9 @@ require 'puppet/network/client'
6
6
  class CucumberPuppet
7
7
  # Returns a new CucumberPuppet object.
8
8
  def initialize
9
+ # resources' alias metaparameter
10
+ @aliases = {}
11
+
9
12
  @confdir = "/etc/puppet"
10
13
  @manifest = @confdir + "/manifests/site.pp"
11
14
 
@@ -70,11 +73,21 @@ class CucumberPuppet
70
73
  end
71
74
  exit 1
72
75
  end
76
+
77
+ # XXX could not find this in puppet
78
+ catalog_resources.each do |resource|
79
+ next unless resource[:alias]
80
+ resource[:alias].each do |a|
81
+ # "foo" -> "Package[foo]"
82
+ @aliases["#{resource.type}[#{a}]"] = resource
83
+ end
84
+ end
73
85
  end
74
86
 
75
- # Returns an Object with the given title from catalog.
87
+ # Returns an Object with the given title from catalog, taking aliases
88
+ # into account.
76
89
  def resource(title)
77
- @catalog.resource(title)
90
+ @catalog.resource(title) || @aliases[title]
78
91
  end
79
92
 
80
93
  # Returns an Array with the catalog's Puppet::Resource objects.
@@ -82,12 +95,12 @@ class CucumberPuppet
82
95
  # This method exists to supply a common interface to the puppet catalog
83
96
  # for different versions of puppet.
84
97
  @catalog.resources.map do |r|
85
- if r.is_a?(Puppet::Resource)
86
- # puppet 2.6 and newer
87
- r
88
- elsif r.is_a?(String)
98
+ if r.is_a?(String)
89
99
  # puppet 0.25 and older
90
100
  resource(r)
101
+ elsif r.is_a?(Puppet::Resource)
102
+ # puppet 2.6 and newer
103
+ r
91
104
  else
92
105
  raise "Unknown resource object #{r.class}"
93
106
  end
@@ -1,10 +1,10 @@
1
- .\" generated with Ronn/v0.7.3
2
- .\" http://github.com/rtomayko/ronn/tree/0.7.3
1
+ .\" generated with Ronn/v0.5
2
+ .\" http://github.com/rtomayko/ronn/
3
3
  .
4
4
  .TH "CUCUMBER\-PUPPET\-GEN" "1" "September 2010" "" ""
5
5
  .
6
6
  .SH "NAME"
7
- \fBcucumber\-puppet\-gen\fR \- Generator script for cucumber\-puppet
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,15 +13,19 @@
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 for use with \fBcucumber\-puppet\fR\.
16
+ \fBcucumber\-puppet\-gen\fR generates feature files and initializes a Puppet tree
17
+ for use with \fBcucumber\-puppet\fR.
17
18
  .
18
19
  .TP
19
20
  \fBcucumber\-puppet\-gen\fR feature MODULE FEATURE
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\.
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.
21
24
  .
22
25
  .TP
23
26
  \fBcucumber\-puppet\-gen\fR world
24
- Initialize Puppet tree for use with \fBcucumber\-puppet\fR, to be run from the Puppet tree\'s root\.
27
+ Initialize Puppet tree for use with \fBcucumber\-puppet\fR, to be run from the
28
+ Puppet tree's root.
25
29
  .
26
30
  .SH "EXAMPLES"
27
31
  Initialize the Puppet tree:
@@ -38,10 +42,10 @@ $ cucumber\-puppet\-gen world
38
42
  .IP "" 0
39
43
  .
40
44
  .P
41
- Generated files are to be found in \fBfeatures/steps/\fR and \fBfeatures/support/\fR\.
45
+ Generated files are to be found in \fBfeatures/steps/\fR and \fBfeatures/support/\fR.
42
46
  .
43
47
  .P
44
- Create a feature file for module \fIfoo\fR\'s \fIbar\fR feature:
48
+ Create a feature file for module \fIfoo\fR's \fIbar\fR feature:
45
49
  .
46
50
  .IP "" 4
47
51
  .
@@ -69,10 +73,12 @@ $ cucumber\-puppet\-gen feature foo bar
69
73
  .IP "" 0
70
74
  .
71
75
  .SH "REPORTING BUGS"
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\.
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.
73
79
  .
74
80
  .SH "COPYRIGHT"
75
- \fBcucumber\-puppet\fR is Copyright (c) 2010 Nikolay Sturm \fIsturm@nistu\.de\fR
81
+ \fBcucumber\-puppet\fR is Copyright (c) 2010 Nikolay Sturm \fIsturm@nistu.de\fR
76
82
  .
77
83
  .SH "SEE ALSO"
78
84
  cucumber\-puppet(1)
@@ -1,96 +1,107 @@
1
- .\" generated with Ronn/v0.7.3
2
- .\" http://github.com/rtomayko/ronn/tree/0.7.3
1
+ .\" generated with Ronn/v0.5
2
+ .\" http://github.com/rtomayko/ronn/
3
3
  .
4
4
  .TH "CUCUMBER\-PUPPET" "1" "September 2010" "" ""
5
5
  .
6
6
  .SH "NAME"
7
- \fBcucumber\-puppet\fR \- Puppet catalog testing with Cucumber
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\. It provides the glue necessary to access Puppet\'s data structures from Cucumber\'s step definitions\.
13
+ \fBcucumber\-puppet\fR is a tool for behavioral testing of Puppet catalogs. It
14
+ provides the glue necessary to access Puppet's data structures from Cucumber's
15
+ step definitions.
14
16
  .
15
17
  .P
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\.
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.
17
21
  .
18
22
  .TP
19
23
  \fB\-h\fR, \fB\-\-help\fR
20
- Show help message\.
24
+ Show help message.
21
25
  .
22
26
  .TP
23
27
  \fB\-\-version\fR
24
- Show version number\.
28
+ Show version number.
25
29
  .
26
30
  .P
27
- The following options are passed on to \fBcucumber\fR\. See \fBcucumber \-\-help\fR for further details\.
31
+ The following options are passed on to \fBcucumber\fR. See \fBcucumber \-\-help\fR for
32
+ further details.
28
33
  .
29
34
  .TP
30
35
  \fB\-b\fR, \fB\-\-backtrace\fR
31
- Show full backtrace for all errors\.
36
+ Show full backtrace for all errors.
32
37
  .
33
38
  .TP
34
39
  \fB\-e\fR, \fB\-\-exclude\fR \fIPATTERN\fR
35
- Don\'t run feature files or require ruby files matching \fIPATTERN\fR\.
40
+ Don't run feature files or require ruby files matching \fIPATTERN\fR.
36
41
  .
37
42
  .TP
38
43
  \fB\-f\fR, \fB\-\-format\fR \fIFORMAT\fR
39
- How to format features (Default: pretty)\.
44
+ How to format features (Default: pretty).
40
45
  .
41
46
  .TP
42
47
  \fB\-n\fR, \fB\-\-name\fR \fINAME\fR
43
- Only run matching feature elements\.
48
+ Only run matching feature elements.
44
49
  .
45
50
  .TP
46
51
  \fB\-o\fR, \fB\-\-out\fR \fIFILE\fR|\fIDIR\fR
47
- Write output to \fIFILE\fR|\fIDIR\fR\.
52
+ Write output to \fIFILE\fR|\fIDIR\fR.
48
53
  .
49
54
  .TP
50
55
  \fB\-t\fR, \fB\-\-tags\fR \fITAG\-EXPRESSION\fR
51
- Only run features/scenarios matching \fITAG\-EXPRESSION\fR\.
56
+ Only run features/scenarios matching \fITAG\-EXPRESSION\fR.
52
57
  .
53
58
  .TP
54
59
  \fB\-v\fR, \fB\-\-verbose\fR
55
- Show files and features loaded\.
60
+ Show files and features loaded.
56
61
  .
57
62
  .TP
58
63
  \fB\-x\fR, \fB\-\-expand\fR
59
- Expand Scenario Outline Tables in output\.
64
+ Expand Scenario Outline Tables in output.
60
65
  .
61
66
  .SH "FILES"
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:
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:
63
70
  .
64
71
  .TP
65
72
  \fBfeatures/\fR
66
- The generic place to store Cucumber files\.
73
+ The generic place to store Cucumber files.
67
74
  .
68
75
  .TP
69
76
  \fBfeatures/modules/foo/\fR
70
- Feature files for module \fIfoo\fR go here\.
77
+ Feature files for module \fIfoo\fR go here.
71
78
  .
72
79
  .TP
73
- \fBfeatures/modules/foo/bar\.feature\fR
74
- File containing scenarios for the \fIbar\fR feature\.
80
+ \fBfeatures/modules/foo/bar.feature\fR
81
+ File containing scenarios for the \fIbar\fR feature.
75
82
  .
76
83
  .TP
77
84
  \fBfeatures/steps/\fR
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\.
85
+ Step definitions go here. To distinguish local extensions, it is suggested
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.
79
89
  .
80
90
  .TP
81
91
  \fBfeatures/support/\fR
82
- Cucumber support files go here\.
92
+ Cucumber support files go here.
83
93
  .
84
94
  .P
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:
95
+ \fBcucumber\-puppet\fR also supports bundling features with modules. In this case it
96
+ looks for features, step definitions and support files in \fBmodules/foo/features/\fR like so:
86
97
  .
87
98
  .TP
88
- \fBmodules/foo/features/bar\.feature\fR
89
- Bundled feature file\.
99
+ \fBmodules/foo/features/bar.feature\fR
100
+ Bundled feature file.
90
101
  .
91
102
  .TP
92
- \fBmodules/foo/features/steps/bar\.rb\fR
93
- Bundled step definition file\.
103
+ \fBmodules/foo/features/steps/bar.rb\fR
104
+ Bundled step definition file.
94
105
  .
95
106
  .SH "EXAMPLES"
96
107
  To run all features found in a directory:
@@ -112,26 +123,32 @@ To run a single feature:
112
123
  .
113
124
  .nf
114
125
 
115
- $ cucumber\-puppet features/modules/foo/bar\.feature
126
+ $ cucumber\-puppet features/modules/foo/bar.feature
116
127
  .
117
128
  .fi
118
129
  .
119
130
  .IP "" 0
120
131
  .
121
132
  .SH "REPORTING BUGS"
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\.
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.
123
136
  .
124
137
  .SH "COPYRIGHT"
125
- \fBcucumber\-puppet\fR is Copyright (c) 2010 Nikolay Sturm \fIsturm@nistu\.de\fR
138
+ \fBcucumber\-puppet\fR is Copyright (c) 2010 Nikolay Sturm \fIsturm@nistu.de\fR
126
139
  .
127
140
  .SH "SEE ALSO"
128
141
  cucumber\-puppet\-gen(1)
129
142
  .
130
143
  .P
131
- Behavior Driven Development: http://behaviour\-driven\.org/ http://en\.wikipedia\.org/wiki/Behavior_driven_development
144
+ Behavior Driven Development:
145
+ http://behaviour\-driven.org/
146
+ http://en.wikipedia.org/wiki/Behavior_driven_development
132
147
  .
133
148
  .P
134
- Cucumber: http://cukes\.info/
149
+ Cucumber:
150
+ http://cukes.info/
135
151
  .
136
152
  .P
137
- Puppet: http://www\.puppetlabs\.com/puppet/introduction/
153
+ Puppet:
154
+ http://www.puppetlabs.com/puppet/introduction/
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-puppet
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 1
9
- - 0
10
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
11
10
  platform: ruby
12
11
  authors:
13
12
  - Nikolay Sturm
@@ -15,18 +14,16 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-10-20 00:00:00 +02:00
17
+ date: 2010-11-01 00:00:00 +01:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: cucumber
23
22
  prerelease: false
24
23
  requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
24
  requirements:
27
25
  - - ">="
28
26
  - !ruby/object:Gem::Version
29
- hash: 15
30
27
  segments:
31
28
  - 0
32
29
  - 6
@@ -38,11 +35,9 @@ dependencies:
38
35
  name: gem-man
39
36
  prerelease: false
40
37
  requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
38
  requirements:
43
39
  - - ">="
44
40
  - !ruby/object:Gem::Version
45
- hash: 23
46
41
  segments:
47
42
  - 0
48
43
  - 2
@@ -54,11 +49,9 @@ dependencies:
54
49
  name: templater
55
50
  prerelease: false
56
51
  requirement: &id003 !ruby/object:Gem::Requirement
57
- none: false
58
52
  requirements:
59
53
  - - ">="
60
54
  - !ruby/object:Gem::Version
61
- hash: 15
62
55
  segments:
63
56
  - 1
64
57
  - 0
@@ -87,15 +80,15 @@ files:
87
80
  - man/cucumber-puppet.1
88
81
  - man/cucumber-puppet-gen.1
89
82
  - VERSION.yml
90
- - lib/generators/world/steps/package.rb
91
- - lib/generators/world/steps/exec.rb
83
+ - lib/generators/world/support/world.rb
84
+ - lib/generators/world/support/hooks.rb
92
85
  - lib/generators/world/steps/user.rb
93
- - lib/generators/world/steps/file.rb
94
- - lib/generators/world/steps/cron.rb
95
86
  - lib/generators/world/steps/puppet.rb
87
+ - lib/generators/world/steps/cron.rb
96
88
  - lib/generators/world/steps/service.rb
97
- - lib/generators/world/support/hooks.rb
98
- - lib/generators/world/support/world.rb
89
+ - lib/generators/world/steps/package.rb
90
+ - lib/generators/world/steps/exec.rb
91
+ - lib/generators/world/steps/file.rb
99
92
  has_rdoc: true
100
93
  homepage: http://projects.puppetlabs.com/projects/cucumber-puppet
101
94
  licenses: []
@@ -106,27 +99,23 @@ rdoc_options: []
106
99
  require_paths:
107
100
  - lib
108
101
  required_ruby_version: !ruby/object:Gem::Requirement
109
- none: false
110
102
  requirements:
111
103
  - - ">="
112
104
  - !ruby/object:Gem::Version
113
- hash: 3
114
105
  segments:
115
106
  - 0
116
107
  version: "0"
117
108
  required_rubygems_version: !ruby/object:Gem::Requirement
118
- none: false
119
109
  requirements:
120
110
  - - ">="
121
111
  - !ruby/object:Gem::Version
122
- hash: 3
123
112
  segments:
124
113
  - 0
125
114
  version: "0"
126
115
  requirements: []
127
116
 
128
117
  rubyforge_project:
129
- rubygems_version: 1.3.7
118
+ rubygems_version: 1.3.6
130
119
  signing_key:
131
120
  specification_version: 3
132
121
  summary: Puppet catalog testing with Cucumber