cuken 0.1.4 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.relish +2 -0
- data/Gemfile +4 -4
- data/Gemfile.lock +17 -23
- data/VERSION +1 -1
- data/cuken.gems +108 -0
- data/cuken.gemspec +33 -10
- data/features/about.md +15 -2
- data/features/chef_examples/cookbooks_cookbook.feature +38 -3
- data/features/chef_examples/cookbooks_remote_repo.feature +10 -0
- data/features/chef_examples/cookbooks_repo.feature +5 -5
- data/features/{chef_steps → chef_examples}/knife_admin_client.feature +4 -4
- data/features/chef_examples/knife_client_create.feature +13 -0
- data/features/chef_steps/common_steps.feature +2 -2
- data/features/chef_steps/cookbook_steps.feature +12 -5
- data/features/chef_steps/node_steps.feature +1 -1
- data/features/file_steps/file_steps.feature +11 -11
- data/lib/cuken/all.rb +4 -0
- data/lib/cuken/api/chef/common.rb +46 -8
- data/lib/cuken/api/chef/knife.rb +107 -0
- data/lib/cuken/api/chef.rb +21 -13
- data/lib/cuken/api/common.rb +12 -0
- data/lib/cuken/api/rvm.rb +501 -0
- data/lib/cuken/api/ssh-forever.rb +237 -0
- data/lib/cuken/chef.rb +2 -0
- data/lib/cuken/common.rb +1 -0
- data/lib/cuken/cucumber/chef/common.rb +4 -2
- data/lib/cuken/cucumber/chef/cookbook.rb +87 -12
- data/lib/cuken/cucumber/chef/data_bag.rb +27 -0
- data/lib/cuken/cucumber/chef/knife.rb +10 -0
- data/lib/cuken/cucumber/chef/node.rb +20 -8
- data/lib/cuken/cucumber/chef/role.rb +18 -1
- data/lib/cuken/cucumber/chef.rb +5 -3
- data/lib/cuken/cucumber/cmd.rb +1 -1
- data/lib/cuken/cucumber/file.rb +18 -2
- data/lib/cuken/cucumber/rvm.rb +4 -0
- data/lib/cuken/rvm.rb +3 -0
- data/spec/api/knife_spec.rb +94 -0
- data/spec/api/rvm_spec.rb +274 -0
- data/spec/api/rvmrc_processor_spec.rb +288 -0
- data/spec/spec_helper.rb +58 -2
- metadata +67 -30
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,68 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
2
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
3
|
require 'rspec'
|
4
|
-
require '
|
4
|
+
require 'stringio'
|
5
|
+
require 'fakefs/safe'
|
6
|
+
require 'fakefs/spec_helpers'
|
7
|
+
require 'rvm'
|
8
|
+
require 'rr'
|
9
|
+
require 'chef/mixins'
|
10
|
+
require 'chef/knife/configure'
|
11
|
+
require 'chef/knife/client_create'
|
12
|
+
|
13
|
+
require 'cuken/api/rvm'
|
14
|
+
require 'cuken/api/chef'
|
15
|
+
require 'cuken/api/chef/knife'
|
5
16
|
|
6
17
|
# Requires supporting files with custom matchers and macros, etc,
|
7
18
|
# in ./support/ and its subdirectories.
|
8
19
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
20
|
|
10
21
|
RSpec.configure do |config|
|
11
|
-
|
22
|
+
|
23
|
+
config.mock_with :rr
|
24
|
+
include ::Cuken::Api::Chef
|
25
|
+
# or if that doesn't work due to a version incompatibility
|
26
|
+
# config.mock_with RR::Adapters::Rspec
|
12
27
|
end
|
28
|
+
|
29
|
+
def test_rvmrc(rubie, gemset_name)
|
30
|
+
%Q{
|
31
|
+
ruby_id="#{rubie}"
|
32
|
+
gemset_id="#{gemset_name}"
|
33
|
+
environment_id=${ruby_id}@${gemset_id}
|
34
|
+
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
|
35
|
+
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] ; then
|
36
|
+
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
37
|
+
else
|
38
|
+
# If the environment file has not yet been created, use the RVM CLI to select.
|
39
|
+
rvm --create "$environment_id"
|
40
|
+
fi
|
41
|
+
filename=${gemset_id}.gems
|
42
|
+
if [[ -s "$filename" ]] ; then
|
43
|
+
rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
|
44
|
+
fi
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_gems
|
49
|
+
%Q{
|
50
|
+
# cuken.gems generated gem export file. Note that any env variable settings will be missing. Append these after using a ';' field separator
|
51
|
+
1 -v1.0.0
|
52
|
+
2 -v3.0.5
|
53
|
+
3 -v0.6.7
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
def setup_rvmrc_gems_files(count)
|
58
|
+
root= FileUtils.mkpath("/path/to/dir", :mode => 0755)
|
59
|
+
full="/path/to/dir/#{(1..count).to_a.join('/')}"
|
60
|
+
FileUtils.mkpath(full, :mode => 0755)
|
61
|
+
Pathname(full).ascend do |d|
|
62
|
+
num = File.basename d
|
63
|
+
File.open("#{d.to_s}/.rvmrc", "w") { |f| f << test_rvmrc("ruby-1.9.2-p136", num) }
|
64
|
+
File.open("#{d.to_s}/#{num}.gems", "w") { |f| f << test_gems }
|
65
|
+
end
|
66
|
+
root.to_s
|
67
|
+
end
|
68
|
+
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: cuken
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Hedgehog
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable:
|
13
|
+
date: 2011-04-17 00:00:00 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: aruba
|
@@ -25,63 +24,74 @@ dependencies:
|
|
25
24
|
prerelease: false
|
26
25
|
version_requirements: *id001
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
27
|
+
name: chef
|
29
28
|
requirement: &id002 !ruby/object:Gem::Requirement
|
30
29
|
none: false
|
31
30
|
requirements:
|
32
31
|
- - ~>
|
33
32
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0.
|
33
|
+
version: 0.9.12
|
35
34
|
type: :runtime
|
36
35
|
prerelease: false
|
37
36
|
version_requirements: *id002
|
38
37
|
- !ruby/object:Gem::Dependency
|
39
|
-
name:
|
38
|
+
name: grit
|
40
39
|
requirement: &id003 !ruby/object:Gem::Requirement
|
41
40
|
none: false
|
42
41
|
requirements:
|
43
42
|
- - ~>
|
44
43
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
44
|
+
version: 2.4.1
|
46
45
|
type: :runtime
|
47
46
|
prerelease: false
|
48
47
|
version_requirements: *id003
|
49
48
|
- !ruby/object:Gem::Dependency
|
50
|
-
name:
|
49
|
+
name: rvm
|
51
50
|
requirement: &id004 !ruby/object:Gem::Requirement
|
52
51
|
none: false
|
53
52
|
requirements:
|
54
53
|
- - ~>
|
55
54
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
55
|
+
version: 1.5.2
|
57
56
|
type: :runtime
|
58
57
|
prerelease: false
|
59
58
|
version_requirements: *id004
|
60
59
|
- !ruby/object:Gem::Dependency
|
61
|
-
name:
|
60
|
+
name: rr
|
62
61
|
requirement: &id005 !ruby/object:Gem::Requirement
|
63
62
|
none: false
|
64
63
|
requirements:
|
65
64
|
- - ~>
|
66
65
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
66
|
+
version: 1.0.2
|
68
67
|
type: :development
|
69
68
|
prerelease: false
|
70
69
|
version_requirements: *id005
|
71
70
|
- !ruby/object:Gem::Dependency
|
72
|
-
name:
|
71
|
+
name: rspec
|
73
72
|
requirement: &id006 !ruby/object:Gem::Requirement
|
74
73
|
none: false
|
75
74
|
requirements:
|
76
75
|
- - ~>
|
77
76
|
- !ruby/object:Gem::Version
|
78
|
-
version:
|
77
|
+
version: 2.5.0
|
79
78
|
type: :development
|
80
79
|
prerelease: false
|
81
80
|
version_requirements: *id006
|
82
81
|
- !ruby/object:Gem::Dependency
|
83
|
-
name:
|
82
|
+
name: yard
|
84
83
|
requirement: &id007 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 0.6.0
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: *id007
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: cucumber
|
94
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
85
95
|
none: false
|
86
96
|
requirements:
|
87
97
|
- - ">="
|
@@ -89,21 +99,21 @@ dependencies:
|
|
89
99
|
version: "0"
|
90
100
|
type: :development
|
91
101
|
prerelease: false
|
92
|
-
version_requirements: *
|
102
|
+
version_requirements: *id008
|
93
103
|
- !ruby/object:Gem::Dependency
|
94
104
|
name: bundler
|
95
|
-
requirement: &
|
105
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
96
106
|
none: false
|
97
107
|
requirements:
|
98
108
|
- - ~>
|
99
109
|
- !ruby/object:Gem::Version
|
100
|
-
version: 1.0.
|
110
|
+
version: 1.0.11
|
101
111
|
type: :development
|
102
112
|
prerelease: false
|
103
|
-
version_requirements: *
|
113
|
+
version_requirements: *id009
|
104
114
|
- !ruby/object:Gem::Dependency
|
105
115
|
name: jeweler
|
106
|
-
requirement: &
|
116
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
107
117
|
none: false
|
108
118
|
requirements:
|
109
119
|
- - ~>
|
@@ -111,10 +121,10 @@ dependencies:
|
|
111
121
|
version: 1.5.2
|
112
122
|
type: :development
|
113
123
|
prerelease: false
|
114
|
-
version_requirements: *
|
124
|
+
version_requirements: *id010
|
115
125
|
- !ruby/object:Gem::Dependency
|
116
126
|
name: rcov
|
117
|
-
requirement: &
|
127
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
118
128
|
none: false
|
119
129
|
requirements:
|
120
130
|
- - ">="
|
@@ -122,10 +132,10 @@ dependencies:
|
|
122
132
|
version: "0"
|
123
133
|
type: :development
|
124
134
|
prerelease: false
|
125
|
-
version_requirements: *
|
135
|
+
version_requirements: *id011
|
126
136
|
- !ruby/object:Gem::Dependency
|
127
137
|
name: reek
|
128
|
-
requirement: &
|
138
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
129
139
|
none: false
|
130
140
|
requirements:
|
131
141
|
- - ~>
|
@@ -133,10 +143,10 @@ dependencies:
|
|
133
143
|
version: 1.2.8
|
134
144
|
type: :development
|
135
145
|
prerelease: false
|
136
|
-
version_requirements: *
|
146
|
+
version_requirements: *id012
|
137
147
|
- !ruby/object:Gem::Dependency
|
138
148
|
name: roodi
|
139
|
-
requirement: &
|
149
|
+
requirement: &id013 !ruby/object:Gem::Requirement
|
140
150
|
none: false
|
141
151
|
requirements:
|
142
152
|
- - ~>
|
@@ -144,7 +154,18 @@ dependencies:
|
|
144
154
|
version: 2.1.0
|
145
155
|
type: :development
|
146
156
|
prerelease: false
|
147
|
-
version_requirements: *
|
157
|
+
version_requirements: *id013
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: fakefs
|
160
|
+
requirement: &id014 !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - ~>
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: 0.3.1
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: *id014
|
148
169
|
description: Reusable Cucumber steps and API for post-convergence system integration descriptions
|
149
170
|
email: hedgehogshiatus@gmail.com
|
150
171
|
executables: []
|
@@ -156,6 +177,7 @@ extra_rdoc_files:
|
|
156
177
|
- README.md
|
157
178
|
files:
|
158
179
|
- .document
|
180
|
+
- .relish
|
159
181
|
- .rspec
|
160
182
|
- Gemfile
|
161
183
|
- Gemfile.lock
|
@@ -165,16 +187,19 @@ files:
|
|
165
187
|
- Rakefile
|
166
188
|
- VERSION
|
167
189
|
- cucumber.yml
|
190
|
+
- cuken.gems
|
168
191
|
- cuken.gemspec
|
169
192
|
- examples/chef/features/support/env.rb
|
170
193
|
- features/.nav
|
171
194
|
- features/about.md
|
172
195
|
- features/chef_examples/cookbooks_cookbook.feature
|
173
196
|
- features/chef_examples/cookbooks_metadata.feature
|
197
|
+
- features/chef_examples/cookbooks_remote_repo.feature
|
174
198
|
- features/chef_examples/cookbooks_repo.feature
|
199
|
+
- features/chef_examples/knife_admin_client.feature
|
200
|
+
- features/chef_examples/knife_client_create.feature
|
175
201
|
- features/chef_steps/common_steps.feature
|
176
202
|
- features/chef_steps/cookbook_steps.feature
|
177
|
-
- features/chef_steps/knife_admin_client.feature
|
178
203
|
- features/chef_steps/knife_steps.feature
|
179
204
|
- features/chef_steps/node_steps.feature
|
180
205
|
- features/command_examples/commands.feature
|
@@ -532,11 +557,15 @@ files:
|
|
532
557
|
- features/step_definitions/cuken_steps.rb
|
533
558
|
- features/support/env.rb
|
534
559
|
- lib/cuken.rb
|
560
|
+
- lib/cuken/all.rb
|
535
561
|
- lib/cuken/api/chef.rb
|
536
562
|
- lib/cuken/api/chef/common.rb
|
563
|
+
- lib/cuken/api/chef/knife.rb
|
537
564
|
- lib/cuken/api/cmd.rb
|
538
565
|
- lib/cuken/api/common.rb
|
539
566
|
- lib/cuken/api/file.rb
|
567
|
+
- lib/cuken/api/rvm.rb
|
568
|
+
- lib/cuken/api/ssh-forever.rb
|
540
569
|
- lib/cuken/api/ssh.rb
|
541
570
|
- lib/cuken/api/ssh/password.rb
|
542
571
|
- lib/cuken/chef.rb
|
@@ -546,6 +575,7 @@ files:
|
|
546
575
|
- lib/cuken/cucumber/chef/common.rb
|
547
576
|
- lib/cuken/cucumber/chef/cookbook.rb
|
548
577
|
- lib/cuken/cucumber/chef/cookbook_steps.rb
|
578
|
+
- lib/cuken/cucumber/chef/data_bag.rb
|
549
579
|
- lib/cuken/cucumber/chef/deploy_steps.rb
|
550
580
|
- lib/cuken/cucumber/chef/done_directory_steps.rb
|
551
581
|
- lib/cuken/cucumber/chef/done_file_steps.rb
|
@@ -569,12 +599,16 @@ files:
|
|
569
599
|
- lib/cuken/cucumber/cmd.rb
|
570
600
|
- lib/cuken/cucumber/common.rb
|
571
601
|
- lib/cuken/cucumber/file.rb
|
602
|
+
- lib/cuken/cucumber/rvm.rb
|
572
603
|
- lib/cuken/cucumber/ssh.rb
|
573
604
|
- lib/cuken/file.rb
|
605
|
+
- lib/cuken/rvm.rb
|
574
606
|
- lib/cuken/ssh.rb
|
607
|
+
- spec/api/knife_spec.rb
|
608
|
+
- spec/api/rvm_spec.rb
|
609
|
+
- spec/api/rvmrc_processor_spec.rb
|
575
610
|
- spec/cuken_spec.rb
|
576
611
|
- spec/spec_helper.rb
|
577
|
-
has_rdoc: true
|
578
612
|
homepage: http://github.com/hedgehog/cuken
|
579
613
|
licenses:
|
580
614
|
- Apache 2.0
|
@@ -588,7 +622,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
588
622
|
requirements:
|
589
623
|
- - ">="
|
590
624
|
- !ruby/object:Gem::Version
|
591
|
-
hash: -
|
625
|
+
hash: -3536209968277030369
|
592
626
|
segments:
|
593
627
|
- 0
|
594
628
|
version: "0"
|
@@ -601,11 +635,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
601
635
|
requirements: []
|
602
636
|
|
603
637
|
rubyforge_project:
|
604
|
-
rubygems_version: 1.
|
638
|
+
rubygems_version: 1.7.2
|
605
639
|
signing_key:
|
606
640
|
specification_version: 3
|
607
641
|
summary: Reusable Cucumber steps and API for post-convergence system integration descriptions
|
608
642
|
test_files:
|
609
643
|
- examples/chef/features/support/env.rb
|
644
|
+
- spec/api/knife_spec.rb
|
645
|
+
- spec/api/rvm_spec.rb
|
646
|
+
- spec/api/rvmrc_processor_spec.rb
|
610
647
|
- spec/cuken_spec.rb
|
611
648
|
- spec/spec_helper.rb
|