cuken 0.1.13 → 0.1.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/.rvmrc +61 -0
  2. data/Gemfile +17 -15
  3. data/Gemfile.lock +55 -63
  4. data/VERSION +1 -1
  5. data/cuken.gems +46 -0
  6. data/cuken.gemspec +85 -31
  7. data/features/about.md +4 -0
  8. data/features/avagrant_steps/vagrant_steps.feature +13 -0
  9. data/features/chef_examples/cookbooks_cookbook.feature +1 -1
  10. data/features/chef_examples/cookbooks_metadata.feature +5 -5
  11. data/features/chef_examples/cookbooks_repo.feature +1 -1
  12. data/features/chef_examples/knife_admin_client.feature +12 -12
  13. data/features/chef_examples/knife_client_create.feature +1 -1
  14. data/features/chef_examples/zenoss_example/01_chef_server_setup.feature +1 -1
  15. data/features/chef_examples/zenoss_example/02_monitor_vm_setup.feature +1 -1
  16. data/features/chef_steps/cookbook_steps.feature +6 -16
  17. data/features/command_examples/commands.feature +3 -3
  18. data/features/command_examples/exit_statuses.feature +49 -0
  19. data/features/command_examples/file_system_commands.feature +128 -0
  20. data/features/command_examples/flushing.feature +24 -0
  21. data/features/command_examples/interactive.feature +57 -0
  22. data/features/command_examples/no_clobber.feature +41 -0
  23. data/features/command_examples/output.feature +205 -0
  24. data/features/command_steps/command_steps.feature +49 -42
  25. data/features/file_examples/files.feature +5 -5
  26. data/features/git_examples/git_clone.feature +33 -0
  27. data/features/ssh_examples/ssh.feature +11 -2
  28. data/features/step_definitions/cuken_steps.rb +3 -2
  29. data/features/support/env.rb +2 -1
  30. data/lib/cuken/all.rb +1 -0
  31. data/lib/cuken/api/aruba/api.rb +342 -0
  32. data/lib/cuken/api/aruba/hooks.rb +63 -0
  33. data/lib/cuken/api/aruba/process.rb +74 -0
  34. data/lib/cuken/api/aruba.rb +5 -0
  35. data/lib/cuken/api/chef/common.rb +8 -1
  36. data/lib/cuken/api/chef/cookbook.rb +31 -5
  37. data/lib/cuken/api/chef/knife.rb +3 -3
  38. data/lib/cuken/api/chef/role.rb +3 -3
  39. data/lib/cuken/api/chef.rb +98 -9
  40. data/lib/cuken/api/cmd.rb +8 -8
  41. data/lib/cuken/api/common.rb +11 -23
  42. data/lib/cuken/api/file.rb +38 -38
  43. data/lib/cuken/api/git/clone.rb +25 -0
  44. data/lib/cuken/api/git/common.rb +37 -0
  45. data/lib/cuken/api/git/remote.rb +16 -0
  46. data/lib/cuken/api/git/repository.rb +62 -0
  47. data/lib/cuken/api/git.rb +69 -0
  48. data/lib/cuken/api/rvm/common.rb +10 -0
  49. data/lib/cuken/api/rvm/gemsets.rb +33 -0
  50. data/lib/cuken/api/rvm/wip.rb +554 -0
  51. data/lib/cuken/api/rvm.rb +25 -479
  52. data/lib/cuken/api/ssh.rb +85 -4
  53. data/lib/cuken/api/vagrant/common.rb +7 -4
  54. data/lib/cuken/api/vagrant/v_m.rb +2 -2
  55. data/lib/cuken/api/vagrant.rb +3 -3
  56. data/lib/cuken/common.rb +3 -1
  57. data/lib/cuken/cucumber/chef/common.rb +3 -3
  58. data/lib/cuken/cucumber/chef/cookbook/action.rb +81 -0
  59. data/lib/cuken/cucumber/chef/cookbook/local.rb +71 -0
  60. data/lib/cuken/cucumber/chef/cookbook/remote.rb +37 -0
  61. data/lib/cuken/cucumber/chef/cookbook.rb +3 -140
  62. data/lib/cuken/cucumber/chef/cookbook_steps.rb +1 -1
  63. data/lib/cuken/cucumber/chef/deploy_steps.rb +1 -1
  64. data/lib/cuken/cucumber/chef/done_directory_steps.rb +2 -2
  65. data/lib/cuken/cucumber/chef/done_file_steps.rb +5 -5
  66. data/lib/cuken/cucumber/chef/knife.rb +1 -1
  67. data/lib/cuken/cucumber/chef.rb +1 -1
  68. data/lib/cuken/cucumber/cmd/execution.rb +34 -0
  69. data/lib/cuken/cucumber/cmd/exit_status.rb +30 -0
  70. data/lib/cuken/cucumber/cmd.rb +2 -36
  71. data/lib/cuken/cucumber/common.rb +42 -6
  72. data/lib/cuken/cucumber/file.rb +42 -37
  73. data/lib/cuken/cucumber/git/clone.rb +51 -0
  74. data/lib/cuken/cucumber/git/common.rb +36 -0
  75. data/lib/cuken/cucumber/git/local.rb +19 -0
  76. data/lib/cuken/cucumber/git/remote.rb +22 -0
  77. data/lib/cuken/cucumber/git.rb +26 -0
  78. data/lib/cuken/cucumber/output/all.rb +41 -0
  79. data/lib/cuken/cucumber/output/cmd.rb +46 -0
  80. data/lib/cuken/cucumber/output/stderr.rb +33 -0
  81. data/lib/cuken/cucumber/output/stdout.rb +34 -0
  82. data/lib/cuken/cucumber/rvm/common.rb +0 -0
  83. data/lib/cuken/cucumber/rvm/gemsets.rb +32 -0
  84. data/lib/cuken/cucumber/rvm/hooks.rb +0 -0
  85. data/lib/cuken/cucumber/rvm.rb +3 -1
  86. data/lib/cuken/cucumber/ssh/common.rb +51 -0
  87. data/lib/cuken/cucumber/ssh.rb +3 -35
  88. data/lib/cuken/cucumber/vagrant.rb +1 -1
  89. data/lib/cuken/git.rb +21 -0
  90. data/spec/api/rvm/gemsets/api_spec.rb +41 -0
  91. data/spec/api/rvm/gemsets/helper_spec.rb +19 -0
  92. data/spec/api/rvm_spec.rb +63 -15
  93. data/spec/api/vagrant/v_m/Vagrantfile +82 -0
  94. data/spec/api/vagrant/v_m/api_spec.rb +37 -0
  95. data/spec/spec_helper.rb +39 -0
  96. metadata +123 -45
  97. data/spec/cuken_spec.rb +0 -7
@@ -14,90 +14,95 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
  #
17
- load 'aruba/cucumber.rb' unless defined? ::Aruba
17
+ #load 'aruba/cucumber.rb' unless defined? ::Aruba
18
18
  World(::Cuken::Api::File)
19
19
 
20
20
  #
21
21
  # Refactorings, yet to be submitted to Aruba:
22
22
  #
23
- Given /^the directory "([^"]*)"$/ do |arg1|
24
- Then %Q{a directory named \"#{arg1}\"}
23
+
24
+ When /^the file "([^"]*)" is removed$/ do |file_name|
25
+ remove_file(file_name)
26
+ end
27
+
28
+ Given /^the directory "([^"]*)"$/ do |dir_name|
29
+ create_dir(dir_name)
25
30
  end
26
31
 
27
32
  Given /^the file "([^"]*)" contains nothing$/ do |file_name|
28
- Given %Q{an empty file named "#{file_name}"}
33
+ write_file(file_name, "")
29
34
  end
30
35
 
31
36
  Given /^the file "([^"]*)" contains:$/ do |file_name, file_content|
32
- Given %Q{a file named "#{file_name}" with:}, file_content
37
+ write_file(file_name, file_content)
33
38
  end
34
39
 
35
- When /^I write to "([^"]*)":$/ do |file_name, file_content|
36
- When %Q{I write to "#{file_name}" with:}, file_content
40
+ When /^I write to "([^"]*)":$/ do |file_name, file_content|
41
+ write_file(file_name, file_content)
37
42
  end
38
43
 
39
- When /^I overwrite "([^"]*)":$/ do |file_name, file_content|
40
- When %Q{I overwrite "#{file_name}" with:}, file_content
44
+ When /^I overwrite "([^"]*)":$/ do |file_name, file_content|
45
+ overwrite_file(file_name, file_content)
41
46
  end
42
47
 
43
- When /^I append to "([^"]*)":$/ do |file_name, file_content|
44
- When %Q{I append to "#{file_name}" with:}, file_content
48
+ When /^I append to "([^"]*)":$/ do |file_name, file_content|
49
+ append_to_file(file_name, file_content)
45
50
  end
46
51
 
47
- Then /^the file "([^"]*)" exists$/ do |arg1|
48
- Then %Q{a file named \"#{arg1}\" should exist}
52
+ Then /^the file "([^"]*)" exists$/ do |file|
53
+ check_file_presence([file], true)
49
54
  end
50
55
 
51
- Then /^the file "([^"]*)" does not exist$/ do |arg1|
52
- Then %Q{a file named \"#{arg1}\" should not exist}
56
+ Then /^the file "([^"]*)" does not exist$/ do |file|
57
+ check_file_presence([file], false)
53
58
  end
54
59
 
55
- Then /^the directory "([^"]*)" exists$/ do |arg1|
56
- Then %Q{a directory named \"#{arg1}\" should exist}
60
+ Then /^the directory "([^"]*)" exists$/ do |directory|
61
+ check_directory_presence([directory], true)
57
62
  end
58
63
 
59
- Then /^the directory "([^"]*)" does not exist$/ do |arg1|
60
- Then %Q{a directory named \"#{arg1}\" should not exist}
64
+ Then /^the directory "([^"]*)" does not exist$/ do |directory|
65
+ check_directory_presence([directory], false)
61
66
  end
62
67
 
63
- Then /^the file "([^"]*)" contains "([^"]*)"$/ do |file, content|
64
- Then %Q{the file "#{file}" should contain "#{content}"}
68
+ Then /^the file "([^"]*)" contains "([^"]*)"$/ do |file, partial_content|
69
+ check_file_content(file, partial_content, true)
65
70
  end
66
71
 
67
- Then /^the file "([^"]*)" does not contain "([^"]*)"$/ do |file, content|
68
- Then %Q{the file "#{file}" should not contain "#{content}"}
72
+ Then /^the file "([^"]*)" does not contain "([^"]*)"$/ do |file, partial_content|
73
+ check_file_content(file, partial_content, false)
69
74
  end
70
75
 
71
- Then /^the file "([^"]*)" contains \/([^\/]*)\/$/ do |file, re|
72
- Then %Q{the file "#{file}" should match /#{re}/}
73
- end
76
+ Then /^the file "([^"]*)" matches \/([^\/]*)\/$/ do |file, partial_content|
77
+ check_file_content(file, /#{partial_content}/, true)
78
+ end
74
79
 
75
- Then /^the file "([^"]*)" does not contain \/([^\/]*)\/$/ do |file, re|
76
- Then %Q{the file "#{file}" should not match /#{re}/}
80
+ Then /^the file "([^"]*)" does not match \/([^\/]*)\/$/ do |file, partial_content|
81
+ check_file_content(file, /#{partial_content}/, false)
77
82
  end
78
83
 
79
- Then /^the file "([^"]*)" contains exactly:$/ do |file, content|
80
- Then %Q{the file "#{file}" should contain exactly:}, content
84
+ Then /^the file "([^"]*)" contains exactly:$/ do |file, exact_content|
85
+ check_exact_file_content(file, exact_content)
81
86
  end
82
87
 
83
- Then /^the file "([^"]*)" does not contain exactly:$/ do |file, content|
84
- Then %Q{the file "#{file}" should not contain exactly:}, content
88
+ Then /^the file "([^"]*)" does not contain exactly:$/ do |file, exact_content|
89
+ check_exact_file_content(file, exact_content)
85
90
  end
86
91
 
87
92
  Then /^these directories exist:$/ do |table|
88
- Then %Q{the following directories should exist:}, table
93
+ check_directory_presence(table.raw.map{|directory_row| directory_row[0]}, true)
89
94
  end
90
95
 
91
96
  Then /^these directories do not exist:$/ do |table|
92
- Then %Q{the following directories should not exist:}, table
97
+ check_directory_presence(table.raw.map{|directory_row| directory_row[0]}, false)
93
98
  end
94
99
 
95
100
  Then /^these files exist:$/ do |table|
96
- Then %Q{the following files should exist:}, table
101
+ check_file_presence(table.raw.map{|file_row| file_row[0]}, true)
97
102
  end
98
103
 
99
104
  Then /^these files do not exist:$/ do |table|
100
- Then %Q{the following files should exist:}, table
105
+ check_file_presence(table.raw.map{|file_row| file_row[0]}, false)
101
106
  end
102
107
 
103
108
  #
@@ -164,7 +169,7 @@ Then /^the (.)time of "([^"]*)" changes$/ do |time_type, filename|
164
169
  end
165
170
 
166
171
  Then /^the file "([^"]*)" contains "([^"]*)" exactly "(\d+)" times$/ do |file, partial_content, times|
167
- check_file_content(file, partial_content, true, times)
172
+ check_file_content(file, partial_content, true, times)
168
173
  end
169
174
 
170
175
  Then /^the file "([^"]*)" does not contain "([^"]*)" exactly "(\d+)" times$/ do |file, partial_content, times|
@@ -0,0 +1,51 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ World(::Cuken::Api::Git)
18
+
19
+ Given /^I clone the remote Git repository branch "([^"]*)" to "([^"]*)"$/ do |brnch, repo_path|
20
+ git.local_git_repo = git_clone_repo(repo_path, git.remote_git_repo, {'branch' => brnch})
21
+ end
22
+
23
+ Given /^I clone the Repository "([^"]*)" branch "([^"]*)" to "([^"]*)"$/ do |repo, brnch, repo_path|
24
+ git.local_git_repo = git_clone_repo(repo_path, git.git_uri + repo + '.git', {'branch' => brnch})
25
+ end
26
+
27
+ When /^I clone the Repositories:$/ do |table|
28
+ table.hashes.each do |hsh|
29
+ src = {}
30
+ src['branch'] = hsh['branch'] if hsh['branch']
31
+ src['tag'] = hsh['tag'] if hsh['tag']
32
+ src['ref'] = hsh['ref'] if hsh['ref']
33
+ repo = hsh['repo'] if hsh['repo']
34
+ repo = hsh['repository'] if hsh['repository']
35
+ local_repo = git_clone_repo(hsh['destination'], git.git_uri + repo + '.git', src )
36
+ Pathname(local_repo).exist?.should be_true
37
+ end
38
+ end
39
+
40
+ When /^I shallow clone the Repositories:$/ do |table|
41
+ table.hashes.each do |hsh|
42
+ src = {}
43
+ src['branch'] = hsh['branch'] if hsh['branch']
44
+ src['tag'] = hsh['tag'] if hsh['tag']
45
+ src['ref'] = hsh['ref'] if hsh['ref']
46
+ repo = hsh['repo'] if hsh['repo']
47
+ repo = hsh['repository'] if hsh['repository']
48
+ local_repo = git_clone_repo(hsh['destination'], git.git_uri + repo + '.git', src, false )
49
+ Pathname(local_repo).exist?.should be_true
50
+ end
51
+ end
@@ -0,0 +1,36 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ World(::Cuken::Api::Git)
18
+
19
+ Given /^a default Git repository in "([^"]*)"$/ do |path|
20
+ git.local_git_repo = git_clone_repo(path)
21
+ git.local_git_repo.exist?.should be_true
22
+ end
23
+
24
+ Given /^the remote Git repository "([^"]*)"$/ do |git_repo|
25
+ in_dir do
26
+ repo = Dir.exist?(git_repo) ? Pathname(git_repo).expand_path.realdirpath : git_repo
27
+ git.remote_git_repo = repo
28
+ end
29
+ end
30
+
31
+ Then /^the local Git repository exists$/ do
32
+ git.local_git_repo.exist?.should be_true
33
+ #TODO: check_file_presence([file], true), etc.
34
+ end
35
+
36
+
@@ -0,0 +1,19 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ And /^these local Repositories exist:$/ do |table|
18
+ check_repository_table_presence(table)
19
+ end
@@ -0,0 +1,22 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ Given /^the Git URI "([^"]*)"$/ do |git_uri|
18
+ in_dir do
19
+ repo = Dir.exist?(git_uri) ? Pathname(git_uri).expand_path.realdirpath : git_uri
20
+ git.git_uri = repo
21
+ end
22
+ end
@@ -0,0 +1,26 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ require 'grit'
18
+
19
+ World(::Cuken::Api::Git)
20
+
21
+ require 'cuken/cucumber/git/hooks'
22
+
23
+ require 'cuken/cucumber/git/common'
24
+ require 'cuken/cucumber/git/clone'
25
+ require 'cuken/cucumber/git/local'
26
+ require 'cuken/cucumber/git/remote'
@@ -0,0 +1,41 @@
1
+ ########################################################################################################################
2
+ #
3
+ # Variation on Aruba's output steps
4
+ #
5
+ ########################################################################################################################
6
+
7
+ Then /^the output contains "([^"]*)"$/ do |partial_output|
8
+ assert_partial_output(partial_output)
9
+ end
10
+
11
+ Then /^the output does not contain "([^"]*)"$/ do |partial_output|
12
+ all_output.should_not include(partial_output)
13
+ end
14
+
15
+ Then /^the output contains:$/ do |partial_output|
16
+ all_output.should include(partial_output)
17
+ end
18
+
19
+ Then /^the output does not contain:$/ do |partial_output|
20
+ all_output.should_not include(partial_output)
21
+ end
22
+
23
+ Then /^the output contains exactly "([^"]*)"$/ do |exact_output|
24
+ all_output.should == exact_output
25
+ end
26
+
27
+ Then /^the output contains exactly:$/ do |exact_output|
28
+ all_output.should == exact_output
29
+ end
30
+
31
+ # "the output matches" allows regex in the partial_output, if
32
+ # you don't need regex, use "the output contains" instead since
33
+ # that way, you don't have to escape regex characters that
34
+ # appear naturally in the output
35
+ Then /^the output matches \/([^\/]*)\/$/ do |partial_output|
36
+ all_output.should =~ /#{partial_output}/
37
+ end
38
+
39
+ Then /^the output matches:$/ do |partial_output|
40
+ all_output.should =~ /#{partial_output}/m
41
+ end
@@ -0,0 +1,46 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ #load 'aruba/cucumber.rb' unless defined? ::Aruba
18
+
19
+ #World(::Cuken::Api::Cmd)
20
+
21
+ #
22
+ # These ought be submitted to Aruba...
23
+ #
24
+ Then /^the output from "([^"]*)" contains exactly:$/ do |cmd, exact_output|
25
+ output_from(unescape(cmd)).should == exact_output
26
+ end
27
+
28
+ Then /^the output from "([^"]*)" does not contain exactly:$/ do |cmd, exact_output|
29
+ output_from(unescape(cmd)).should_not == exact_output
30
+ end
31
+
32
+ Then /^the output from "([^"]*)" contains:$/ do |cmd, partial_output|
33
+ output_from(unescape(cmd)).should =~ regexp(partial_output)
34
+ end
35
+
36
+ Then /^the output from "([^"]*)" does not contain:$/ do |cmd, partial_output|
37
+ output_from(unescape(cmd)).should_not =~ regexp(partial_output)
38
+ end
39
+
40
+ Then /^the output from "([^"]*)" contains "([^"]*)"$/ do |cmd, partial_output|
41
+ output_from(cmd).should include(partial_output)
42
+ end
43
+
44
+ Then /^the output from "([^"]*)" does not contain "([^"]*)"$/ do |cmd, partial_output|
45
+ output_from(cmd).should_not include(partial_output)
46
+ end
@@ -0,0 +1,33 @@
1
+ ########################################################################################################################
2
+ #
3
+ # Variation on Aruba's output steps
4
+ #
5
+ ########################################################################################################################
6
+
7
+ Then /^the stderr contains "([^"]*)"$/ do |partial_output|
8
+ all_stderr.should include(partial_output)
9
+ end
10
+
11
+ Then /^the stderr contains:$/ do |partial_output|
12
+ all_stderr.should include(partial_output)
13
+ end
14
+
15
+ Then /^the stderr contains exactly:$/ do |exact_output|
16
+ all_stderr.should == exact_output
17
+ end
18
+
19
+ Then /^the stderr does not contain "([^"]*)"$/ do |partial_output|
20
+ all_stderr.should_not include(partial_output)
21
+ end
22
+
23
+ Then /^the stderr does not contain:$/ do |partial_output|
24
+ all_stderr.should_not include(partial_output)
25
+ end
26
+
27
+ Then /^the stderr from "([^"]*)" contains "([^"]*)"$/ do |cmd, partial_output|
28
+ stderr_from(cmd).should include(partial_output)
29
+ end
30
+
31
+ Then /^the stderr from "([^"]*)" does not contain "([^"]*)"$/ do |cmd, partial_output|
32
+ stderr_from(cmd).should_not include(partial_output)
33
+ end
@@ -0,0 +1,34 @@
1
+ ########################################################################################################################
2
+ #
3
+ # Variation on Aruba's output steps
4
+ #
5
+ ########################################################################################################################
6
+
7
+ Then /^the stdout contains "([^"]*)"$/ do |partial_output|
8
+ all_stdout.should include(partial_output)
9
+ end
10
+
11
+ Then /^the stdout contains:$/ do |partial_output|
12
+ all_stdout.should include(partial_output)
13
+ end
14
+
15
+ Then /^the stdout contains exactly:$/ do |exact_output|
16
+ all_stdout.should == exact_output
17
+ end
18
+
19
+ Then /^the stdout does not contain "([^"]*)"$/ do |partial_output|
20
+ all_stdout.should_not include(partial_output)
21
+ end
22
+
23
+ Then /^the stdout does not contain:$/ do |partial_output|
24
+ all_stdout.should_not include(partial_output)
25
+ end
26
+
27
+ Then /^the stdout from "([^"]*)" contains "([^"]*)"$/ do |cmd, partial_output|
28
+ stdout_from(cmd).should include(partial_output)
29
+ end
30
+
31
+ Then /^the stdout from "([^"]*)" does not contain "([^"]*)"$/ do |cmd, partial_output|
32
+ stdout_from(cmd).should_not include(partial_output)
33
+ end
34
+
File without changes
@@ -0,0 +1,32 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ World(::Cuken::Api::Rvm::Gemsets)
18
+
19
+ Given /^the Gemset "([^"]*)" is active$/ do |gemset|
20
+ check_gemset_activation(gemset, true)
21
+ end
22
+
23
+ Given /^the Gemset "([^"]*)" is not active$/ do |gemset|
24
+ check_gemset_activation(gemset, true)
25
+ end
26
+ Given /^the Gemset "([^"]*)" exists$/ do |gemset|
27
+ check_gemset_presence([gemset], true)
28
+ end
29
+ Given /^the Gemset "([^"]*)" does not exist$/ do |gemset|
30
+ check_gemset_presence([gemset], true)
31
+ end
32
+
File without changes
@@ -14,7 +14,9 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
  #
17
- load 'aruba/cucumber.rb' unless defined? ::Aruba
17
+ #load 'aruba/cucumber.rb' unless defined? ::Aruba
18
18
 
19
19
  World(::Cuken::Api::Rvm)
20
20
 
21
+ require 'cuken/cucumber/rvm/common'
22
+ require 'cuken/cucumber/rvm/gemsets'
@@ -0,0 +1,51 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ Given /^a SSH client user "([^\"]*)"$/ do |name|
18
+ ssh_client_hostname name
19
+ end
20
+
21
+ Given /^a SSH client user$/ do
22
+ ssh_client_hostname
23
+ end
24
+
25
+ Given /^a SSH client hostname "([^\"]*)"$/ do |name|
26
+ ssh_client_hostname name
27
+ end
28
+
29
+ Given /^a SSH client hostname$/ do
30
+ ssh_client_hostname
31
+ end
32
+
33
+ Given /^default ssh-forever options$/ do
34
+ ssh_forever_options(:default)
35
+ end
36
+
37
+ Given /^the ssh-forever options:$/ do |table|
38
+ ssh_forever_options(table)
39
+ end
40
+
41
+ When /^I SSH to:$/ do |table|
42
+ ssh_init_password_less_batch(table)
43
+ end
44
+
45
+ When /^I interactively SSH to:$/ do |table|
46
+ ssh_init_password_less_interactive(table)
47
+ end
48
+
49
+ Given /^I initialize password-less SSH access$/ do
50
+ ssh_init_password_less
51
+ end
@@ -14,44 +14,12 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
  #
17
- load 'aruba/cucumber.rb' unless defined? ::Aruba
17
+ #load 'aruba/cucumber.rb' unless defined? ::Aruba
18
18
 
19
19
  World(::Cuken::Api::Ssh)
20
20
 
21
- Before do
22
- @aruba_timeout_seconds.nil? || @aruba_timeout_seconds < 5 ? @aruba_timeout_seconds = 5 : @aruba_timeout_seconds
23
- end
21
+ require 'cuken/cucumber/ssh/common'
22
+ require 'cuken/cucumber/ssh/hooks'
24
23
 
25
- Given /^a SSH client user "([^\"]*)"$/ do |name|
26
- ssh_client_hostname name
27
- end
28
-
29
- Given /^a SSH client user$/ do
30
- ssh_client_hostname
31
- end
32
-
33
- Given /^a SSH client hostname "([^\"]*)"$/ do |name|
34
- ssh_client_hostname name
35
- end
36
-
37
- Given /^a SSH client hostname$/ do
38
- ssh_client_hostname
39
- end
40
-
41
- Given /^default ssh-forever options$/ do
42
- ssh_forever_options(:default)
43
- end
44
-
45
- Given /^the ssh-forever options:$/ do |table|
46
- ssh_forever_options(table)
47
- end
48
-
49
- When /^I initialize password-less SSH access for:$/ do |table|
50
- ssh_init_password_less_batch(table)
51
- end
52
-
53
- Given /^I initialize password-less SSH access$/ do
54
- ssh_init_password_less
55
- end
56
24
 
57
25
 
@@ -14,7 +14,7 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
  #
17
- load 'aruba/cucumber.rb' unless defined? ::Aruba
17
+ #load 'aruba/cucumber.rb' unless defined? ::Aruba
18
18
  require 'grit'
19
19
 
20
20
  World(::Cuken::Api::Vagrant)
data/lib/cuken/git.rb ADDED
@@ -0,0 +1,21 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ require 'grit'
18
+
19
+ require 'cuken/common'
20
+ require 'cuken/api/git'
21
+ require 'cuken/cucumber/git'