cucumber-puppet 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/bin/cucumber-puppet +7 -15
- data/bin/cucumber-puppet-gen +24 -1
- data/lib/cucumber-puppet/puppet.rb +5 -1
- data/lib/generators/world/steps/cron.rb +6 -0
- data/lib/generators/world/steps/exec.rb +5 -0
- data/lib/generators/world/support/world.rb +10 -0
- metadata +5 -3
data/VERSION.yml
CHANGED
data/bin/cucumber-puppet
CHANGED
@@ -1,28 +1,20 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
unless ARGV[0]
|
4
|
-
puts "Usage: cucumber-puppet <feature> [<feature> <feature> ...]"
|
5
|
-
exit
|
4
|
+
puts "Usage: cucumber-puppet [options] <feature> [<feature> <feature> ...]"
|
5
|
+
exit 0
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
exit 1
|
12
|
-
end
|
13
|
-
}
|
8
|
+
command = ""
|
9
|
+
command << "cucumber "
|
10
|
+
command << "--strict "
|
14
11
|
|
15
12
|
# XXX be more creative, finding this directory
|
16
13
|
features_dir = "features"
|
17
|
-
|
18
|
-
|
19
|
-
exit 1
|
14
|
+
if File.directory?(features_dir)
|
15
|
+
command << "--require #{features_dir} "
|
20
16
|
end
|
21
17
|
|
22
|
-
command = ""
|
23
|
-
command << "cucumber "
|
24
|
-
command << "--strict "
|
25
|
-
command << "--require #{features_dir} "
|
26
18
|
command << ARGV.join(' ')
|
27
19
|
|
28
20
|
system(command) ? exit(0) : exit(1)
|
data/bin/cucumber-puppet-gen
CHANGED
@@ -27,6 +27,21 @@ module CucumberPuppetGenerators
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
class TestcaseGenerator < Templater::Generator
|
31
|
+
def source_root
|
32
|
+
File.join(File.dirname(__FILE__), '..', 'lib', 'generators', 'testcase')
|
33
|
+
end
|
34
|
+
|
35
|
+
desc <<-DESC
|
36
|
+
Generate a test case for cucumber-puppet's test suite
|
37
|
+
cucumber-puppet-gen testcase
|
38
|
+
DESC
|
39
|
+
|
40
|
+
file('testcase.feature', 'testcase.feature', 'features/testcase.feature')
|
41
|
+
file('testcase.rb', 'testcase.rb', 'features/support/testcase.rb')
|
42
|
+
file('site.pp', 'site.pp')
|
43
|
+
end
|
44
|
+
|
30
45
|
class WorldGenerator < Templater::Generator
|
31
46
|
def source_root
|
32
47
|
File.join(File.dirname(__FILE__), '..', 'lib', 'generators', 'world')
|
@@ -41,12 +56,20 @@ module CucumberPuppetGenerators
|
|
41
56
|
cucumber-puppet-gen world
|
42
57
|
DESC
|
43
58
|
|
59
|
+
first_argument :version, :required => false, :desc => "Puppet version"
|
60
|
+
|
61
|
+
template :version do |template|
|
62
|
+
template.source = "support/world.rb"
|
63
|
+
template.destination = "support/world.rb"
|
64
|
+
end
|
65
|
+
|
44
66
|
directory('steps', 'steps')
|
45
|
-
|
67
|
+
file('support/hooks.rb', 'support/hooks.rb')
|
46
68
|
end
|
47
69
|
|
48
70
|
desc "Generators for cucumber-puppet"
|
49
71
|
add :feature, FeatureGenerator
|
72
|
+
add :testcase, TestcaseGenerator
|
50
73
|
add :world, WorldGenerator
|
51
74
|
|
52
75
|
end
|
@@ -39,7 +39,11 @@ class CucumberPuppet
|
|
39
39
|
|
40
40
|
begin
|
41
41
|
# Compile our catalog
|
42
|
-
|
42
|
+
begin
|
43
|
+
@catalog = Puppet::Resource::Catalog.find(node.name, :use_node => node)
|
44
|
+
rescue NameError
|
45
|
+
@catalog = Puppet::Node::Catalog.find(node.name, :use_node => node)
|
46
|
+
end
|
43
47
|
rescue => detail
|
44
48
|
if Puppet[:trace]
|
45
49
|
puts detail.backtrace
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Nikolay Sturm
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-21 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -59,6 +59,8 @@ files:
|
|
59
59
|
- lib/cucumber-puppet.rb
|
60
60
|
- lib/cucumber-puppet/puppet.rb
|
61
61
|
- lib/generators/feature/%feature_name%.feature
|
62
|
+
- lib/generators/world/steps/cron.rb
|
63
|
+
- lib/generators/world/steps/exec.rb
|
62
64
|
- lib/generators/world/steps/file.rb
|
63
65
|
- lib/generators/world/steps/package.rb
|
64
66
|
- lib/generators/world/steps/puppet.rb
|