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
@@ -0,0 +1,128 @@
1
+ Feature: file system commands
2
+
3
+ In order to specify commands that load files
4
+ As a developer using Cucumber
5
+ I want to create temporary files
6
+
7
+ Scenario: create a dir
8
+ Given a directory named "foo/bar"
9
+ When I run `ruby -e "puts test ?d, 'foo'"`
10
+ Then the stdout should contain "true"
11
+
12
+ Scenario: create a file
13
+ Given a file named "foo/bar/example.rb" with:
14
+ """
15
+ puts "hello world"
16
+ """
17
+ When I run `ruby foo/bar/example.rb`
18
+ Then the output should contain "hello world"
19
+
20
+ Scenario: append to a file
21
+ Given a file named "foo/bar/example.rb" with:
22
+ """
23
+ puts "hello world"
24
+ """
25
+ When I append to "foo/bar/example.rb" with:
26
+ """
27
+ puts "this was appended"
28
+ """
29
+ When I run `ruby foo/bar/example.rb`
30
+ Then the output should contain "hello world"
31
+ And the output should contain "this was appended"
32
+
33
+ Scenario: clean up files generated in previous scenario
34
+ When I run `ruby foo/bar/example.rb`
35
+ Then the exit status should be 1
36
+ And the output should contain "No such file or directory -- foo/bar/example.rb"
37
+
38
+ Scenario: change to a subdir
39
+ Given a file named "foo/bar/example.rb" with:
40
+ """
41
+ puts "hello world"
42
+ """
43
+ When I cd to "foo/bar"
44
+ And I run `ruby example.rb`
45
+ Then the output should contain "hello world"
46
+
47
+ Scenario: Reset current directory from previous scenario
48
+ When I run `ruby example.rb`
49
+ Then the exit status should be 1
50
+
51
+ Scenario: Holler if cd to bad dir
52
+ Given a file named "foo/bar/example.rb" with:
53
+ """
54
+ puts "hello world"
55
+ """
56
+ When I do aruba I cd to "foo/nonexistant"
57
+ Then aruba should fail with "tmp/aruba/foo/nonexistant is not a directory"
58
+
59
+ Scenario: Check for presence of a subset of files
60
+ Given an empty file named "lorem/ipsum/dolor"
61
+ Given an empty file named "lorem/ipsum/sit"
62
+ Given an empty file named "lorem/ipsum/amet"
63
+ Then the following files should exist:
64
+ | lorem/ipsum/dolor |
65
+ | lorem/ipsum/amet |
66
+
67
+ Scenario: Check for absence of files
68
+ Then the following files should not exist:
69
+ | lorem/ipsum/dolor |
70
+
71
+ Scenario: Check for presence of a single file
72
+ Given an empty file named "lorem/ipsum/dolor"
73
+ Then a file named "lorem/ipsum/dolor" should exist
74
+
75
+ Scenario: Check for absence of a single file
76
+ Then a file named "lorem/ipsum/dolor" should not exist
77
+
78
+ Scenario: Check for presence of a subset of directories
79
+ Given a directory named "foo/bar"
80
+ Given a directory named "foo/bla"
81
+ Then the following directories should exist:
82
+ | foo/bar |
83
+ | foo/bla |
84
+
85
+ Scenario: check for absence of directories
86
+ Given a directory named "foo/bar"
87
+ Given a directory named "foo/bla"
88
+ Then the following step should fail with Spec::Expectations::ExpectationNotMetError:
89
+ """
90
+ Then the following directories should not exist:
91
+ | foo/bar/ |
92
+ | foo/bla/ |
93
+ """
94
+
95
+ Scenario: Check for presence of a single directory
96
+ Given a directory named "foo/bar"
97
+ Then a directory named "foo/bar" should exist
98
+
99
+ Scenario: Check for absence of a single directory
100
+ Given a directory named "foo/bar"
101
+ Then the following step should fail with Spec::Expectations::ExpectationNotMetError:
102
+ """
103
+ Then a directory named "foo/bar" should not exist
104
+ """
105
+
106
+ Scenario: Check file contents
107
+ Given a file named "foo" with:
108
+ """
109
+ hello world
110
+ """
111
+ Then the file "foo" should contain "hello world"
112
+ And the file "foo" should not contain "HELLO WORLD"
113
+
114
+ Scenario: Check file contents with regexp
115
+ Given a file named "foo" with:
116
+ """
117
+ hello world
118
+ """
119
+ Then the file "foo" should match /hel.o world/
120
+ And the file "foo" should not match /HELLO WORLD/
121
+
122
+ Scenario: Remove file
123
+ Given a file named "foo" with:
124
+ """
125
+ hello world
126
+ """
127
+ When I remove the file "foo"
128
+ Then the file "foo" should not exist
@@ -0,0 +1,24 @@
1
+ Feature: Flushing output
2
+
3
+ In order to test processes that output a lot of data
4
+ As a developer using Aruba
5
+ I want to make sure that large amounts of output aren't buffered
6
+
7
+ Scenario: A little output
8
+ When I run `ruby -e 'puts :a.to_s * 256'`
9
+ Then the output should contain "a"
10
+ And the output should be 256 bytes long
11
+ And the exit status should be 0
12
+
13
+ Scenario: Tons of output
14
+ When I run `ruby -e 'puts :a.to_s * 65536'`
15
+ Then the output should contain "a"
16
+ And the output should be 65536 bytes long
17
+ And the exit status should be 0
18
+
19
+ Scenario: Tons of interactive output
20
+ When I interactively run `ruby -e 'len = gets.chomp; puts :a.to_s * len.to_i'`
21
+ And I type "65536"
22
+ Then the output should contain "a"
23
+ And the output should be 65536 bytes long
24
+ # And the exit status should be 0
@@ -0,0 +1,57 @@
1
+ @announce
2
+ Feature: Interactive process control
3
+
4
+ In order to test interactive command line applications
5
+ As a developer using Cucumber
6
+ I want to use the interactive session steps
7
+ @ssh_remote
8
+ Scenario: Running ruby interactively
9
+ Given the file "echo.rb" contains:
10
+ """
11
+ while res = gets.chomp
12
+ break if res == "quit"
13
+ puts res.reverse
14
+ end
15
+ """
16
+ When I interactively run `ruby echo.rb`
17
+ And I type "hello, world"
18
+ And I type "quit"
19
+ Then the output contains:
20
+ """
21
+ dlrow ,olleh
22
+ """
23
+
24
+ Scenario: Running a native binary interactively
25
+ When I interactively run `bc -q`
26
+ And I type "4 + 3"
27
+ And I type "quit"
28
+ Then the output should contain:
29
+ """
30
+ 7
31
+ """
32
+
33
+ Scenario: Running interactively in a directory outside Aruba's scratch
34
+ When I interactively run `echo 'correct' >discovered.txt` in "/tmp"
35
+ When I run `cat /tmp/discovered.txt`
36
+ Then the output contains:
37
+ """
38
+ correct
39
+ """
40
+ And the file "discovered.txt" does not exist
41
+
42
+ Scenario: Running successfully in a directory outside Aruba's scratch
43
+ When I successfully run `echo 'correct2' >discovered.txt` in "~/tmp/"
44
+ When I run `cat ~/tmp/discovered.txt`
45
+ Then the output contains:
46
+ """
47
+ correct2
48
+ """
49
+ And the file "discovered.txt" does not exist
50
+
51
+ Scenario: Stop processes before checking for filesystem changes
52
+ See: http://github.com/aslakhellesoy/aruba/issues#issue/17 for context
53
+
54
+ Given a directory named "rename_me"
55
+ When I interactively run `mv rename_me renamed`
56
+ Then a directory named "renamed" should exist
57
+ And a directory named "rename_me" should not exist
@@ -0,0 +1,41 @@
1
+ Feature: No clobber
2
+
3
+ By default Aruba removes its scratch directory before
4
+ every scenario. This isn't always the right thing
5
+ to do, especially when the path to the default directory
6
+ has been changed. Use @no-clobber to stop Aruba from
7
+ cleaning up after itself.
8
+
9
+ Scenario: Change the filesystem
10
+ Given a directory named "foo/bar"
11
+ And a file named "foo/bar/baz.txt" with:
12
+ """
13
+ I don't want to die!
14
+ """
15
+
16
+ @no-clobber
17
+ Scenario: Verify nothing was clobbered
18
+ Then a file named "foo/bar/baz.txt" should exist
19
+ And the file "foo/bar/baz.txt" should contain exactly:
20
+ """
21
+ I don't want to die!
22
+ """
23
+
24
+ Scenario: Cleanup and verify the previous scenario
25
+ Then a file named "foo/bar/baz.txt" should not exist
26
+
27
+ # use bash or ruby due to GH issue #69
28
+ Scenario: Do not change the filesystem
29
+ Given I successfully run `bash -c 'echo "I will survive!" >baz.txt'` in "/tmp/foo/bar"
30
+ When I run `cat baz.txt` in "/tmp/foo/bar"
31
+ Then the output should contain "I will survive!"
32
+
33
+ Scenario: Once more verify nothing was clobbered
34
+ Given I run `cat baz.txt` in "/tmp/foo/bar"
35
+ Then the output should contain "I will survive!"
36
+
37
+ Scenario: Adults cleanup after themselves
38
+ Given I run `rm baz.txt` in "/tmp/foo/bar"
39
+ When I run `cat baz.txt` in "/tmp/foo/bar"
40
+ Then the output should not contain "I will survive!"
41
+
@@ -0,0 +1,205 @@
1
+ Feature: Output
2
+
3
+ In order to specify expected output
4
+ As a developer using Cucumber
5
+ I want to use the "the output should contain" step
6
+
7
+ Scenario: Run unknown command
8
+ When I run `neverever gonna work`
9
+ Then the output should contain:
10
+ """
11
+ No such file or directory - neverever
12
+ """
13
+
14
+ Scenario: Detect subset of one-line output
15
+ When I run `ruby -e 'puts \"hello world\"'`
16
+ Then the output should contain "hello world"
17
+
18
+ Scenario: Detect subset of one-line output
19
+ When I run `echo 'hello world'`
20
+ Then the output should contain "hello world"
21
+
22
+ Scenario: Detect absence of one-line output
23
+ When I run `ruby -e 'puts \"hello world\"'`
24
+ Then the output should not contain "good-bye"
25
+
26
+ Scenario: Detect subset of multiline output
27
+ When I run `ruby -e 'puts \"hello\\nworld\"'`
28
+ Then the output should contain:
29
+ """
30
+ hello
31
+ """
32
+
33
+ Scenario: Detect subset of multiline output
34
+ When I run `ruby -e 'puts \"hello\\nworld\"'`
35
+ Then the output should not contain:
36
+ """
37
+ good-bye
38
+ """
39
+
40
+ Scenario: Detect exact one-line output
41
+ When I run `ruby -e 'puts \"hello world\"'`
42
+ Then the output should contain exactly:
43
+ """
44
+ hello world
45
+
46
+ """
47
+
48
+ Scenario: Detect exact multiline output
49
+ When I run `ruby -e 'puts "hello\nworld"'`
50
+ Then the output should contain exactly:
51
+ """
52
+ hello
53
+ world
54
+
55
+ """
56
+
57
+ @announce
58
+ Scenario: Detect subset of one-line output with regex
59
+ When I run `ruby --version`
60
+ Then the output should contain "ruby"
61
+ And the output should match /ruby ([\d]+\.[\d]+\.[\d]+)(p\d+)? \(.*$/
62
+
63
+ @announce
64
+ Scenario: Detect subset of multiline output with regex
65
+ When I run `ruby -e 'puts "hello\nworld\nextra line1\nextra line2\nimportant line"'`
66
+ Then the output should match:
67
+ """
68
+ he..o
69
+ wor.d
70
+ .*
71
+ important line
72
+ """
73
+
74
+ @announce
75
+ Scenario: Match passing exit status and partial output
76
+ When I run `ruby -e 'puts "hello\nworld"'`
77
+ Then it should pass with:
78
+ """
79
+ hello
80
+ """
81
+
82
+ Scenario: Match passing exit status and exact output
83
+ When I run `ruby -e 'puts "hello\nworld"'`
84
+ Then it should pass with exactly:
85
+ """
86
+ hello
87
+ world
88
+
89
+ """
90
+
91
+ @announce-stdout
92
+ Scenario: Match failing exit status and partial output
93
+ When I run `ruby -e 'puts \"hello\\nworld\";exit 99'`
94
+ Then it should fail with:
95
+ """
96
+ hello
97
+ """
98
+
99
+ Scenario: Match failing exit status and exact output
100
+ When I run `ruby -e 'puts "hello\nworld";exit 99'`
101
+ Then it should fail with exactly:
102
+ """
103
+ hello
104
+ world
105
+
106
+ """
107
+
108
+ @announce-stdout
109
+ Scenario: Match failing exit status and output with regex
110
+ When I run `ruby -e 'puts \"hello\\nworld\";exit 99'`
111
+ Then it should fail with regex:
112
+ """
113
+ hello\s*world
114
+ """
115
+
116
+ @announce-cmd
117
+ Scenario: Match output in stdout
118
+ When I run `ruby -e 'puts \"hello\\nworld\"'`
119
+ Then the stdout should contain "hello"
120
+ Then the stderr should not contain "hello"
121
+
122
+ @announce
123
+ Scenario: Match output on several lines
124
+ When I run `ruby -e 'puts %{GET /}'`
125
+ Then the stdout should contain:
126
+ """
127
+ GET /
128
+ """
129
+
130
+ Scenario: Match output on several lines using quotes
131
+ When I run `ruby -e 'puts %{GET "/"}'`
132
+ Then the stdout should contain:
133
+ """
134
+ GET "/"
135
+ """
136
+
137
+ Scenario: Match output in stdout
138
+ When I run `ruby -e 'puts \"hello\\nworld\"'`
139
+ Then the stdout should contain "hello"
140
+ Then the stderr should not contain "hello"
141
+
142
+ Scenario: Detect output from all processes
143
+ When I run `ruby -e 'puts \"hello world!\"'`
144
+ And I interactively run `ruby -e 'puts gets.chomp.reverse'`
145
+ And I type "hello"
146
+ Then the output should contain exactly:
147
+ """
148
+ hello world!
149
+ olleh
150
+
151
+ """
152
+
153
+ Scenario: Detect stdout from all processes
154
+ When I run `ruby -e 'puts \"hello world!\"'`
155
+ And I interactively run `ruby -e 'puts gets.chomp.reverse'`
156
+ And I type "hello"
157
+ Then the stdout should contain:
158
+ """
159
+ hello world!
160
+ olleh
161
+ """
162
+ And the stderr should not contain:
163
+ """
164
+ hello world!
165
+ olleh
166
+ """
167
+
168
+ Scenario: Detect stderr from all processes
169
+ When I run `ruby -e 'STDERR.puts \"hello world!\"'`
170
+ And I interactively run `ruby -e 'STDERR.puts gets.chomp.reverse'`
171
+ And I type "hello"
172
+ Then the stderr should contain:
173
+ """
174
+ hello world!
175
+ olleh
176
+ """
177
+ And the stdout should not contain:
178
+ """
179
+ hello world!
180
+ olleh
181
+ """
182
+
183
+ Scenario: Detect output from named source
184
+ When I run `ruby -e 'puts :simple'`
185
+ And I interactively run `ruby -e 'puts gets.chomp'`
186
+ And I type "interactive"
187
+ Then the output from "ruby -e 'puts :simple'" should contain "simple"
188
+ And the output from "ruby -e 'puts gets.chomp'" should not contain "simple"
189
+
190
+ Scenario: Detect stdout from named source
191
+ When I run `ruby -e 'puts :hello'`
192
+ And I run `ruby -e 'puts :goodbye'`
193
+ Then the stdout from "ruby -e 'puts :hello'" should contain "hello"
194
+ And the stderr from "ruby -e 'puts :hello'" should not contain "hello"
195
+ And the stdout from "ruby -e 'puts :goodbye'" should not contain "hello"
196
+
197
+ Scenario: Detect stderr from named source
198
+ When I run `ruby -e 'STDERR.puts :hello'`
199
+ And I run `ruby -e 'puts :goodbye'`
200
+ Then the stderr from "ruby -e 'STDERR.puts :hello'" should contain "hello"
201
+ And the stdout from "ruby -e 'STDERR.puts :hello'" should not contain "hello"
202
+ And the stderr from "ruby -e 'puts :goodbye'" should not contain "hello"
203
+
204
+ @wip
205
+ Scenario: Detect output from named source with custom name
@@ -8,61 +8,68 @@ Feature: Command steps
8
8
  Given that "cuken/cmd" has been required
9
9
 
10
10
  Scenario: Command execution
11
- Then these steps are defined for "cuken/cucumber/cmd.rb":
12
- | step |
13
- |I run `([^`]*)` |
14
- |I run `([^`]*)` interactively |
15
- |I successfully run `([^`]*)` |
16
- |I type "([^"]*)" |
11
+ Then these steps are defined for "cuken/cucumber/cmd/execution.rb":
12
+ | step |
13
+ |I run `([^`]*)` |
14
+ |I run `([^`]*)` in "([^"]*)" |
15
+ |I interactively run `([^`]*)` |
16
+ |I interactively run `([^`]*)` in "([^"]*)" |
17
+ |I successfully run `([^`]*)` |
18
+ |I successfully run `([^`]*)` in "([^"]*)" |
19
+ |I type "([^"]*)" |
17
20
 
18
21
  Scenario: Command exit status
19
- Then these steps are defined for "cuken/cucumber/cmd.rb":
20
- | step |
21
- |the exit status should be (\d+) |
22
- |the exit status should not be (\d+) |
22
+ Then these steps are defined for "cuken/cucumber/cmd/exit_status.rb":
23
+ | step |
24
+ |the exit status should be (\d+) |
25
+ |the exit status should not be (\d+) |
23
26
  # Pending:
24
27
  # https://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/707-element-size-differs-2-should-be-1-indexerror
25
28
  # |it should (pass|fail) with: |
26
29
  # |it should (pass|fail) with exactly: |
27
30
  # |it should (pass|fail) with regexp?: |
28
31
 
29
- Scenario: Command output (stdout+stderr)
30
- Then these steps are defined for "cuken/cucumber/cmd.rb":
32
+ Scenario: All output (stdout+stderr) per command
33
+ Then these steps are defined for "cuken/cucumber/output/cmd.rb":
34
+ | step |
35
+ |the output from "([^"]*)" contains exactly: |
36
+ |the output from "([^"]*)" does not contain exactly: |
37
+ |the output from "([^"]*)" contains: |
38
+ |the output from "([^"]*)" does not contain: |
39
+ |the output from "([^"]*)" contains "([^"]*)" |
40
+ |the output from "([^"]*)" does not contain "([^"]*)" |
41
+
42
+ Scenario: All output (stdout+stderr) for all commands
43
+ Then these steps are defined for "cuken/cucumber/output/all.rb":
31
44
  | step |
32
- |the output from "(.*)" contains exactly: |
33
- |the output from "([^"]*)" does not contain exactly: |
34
- |the output from "([^"]*)" contains: |
35
- |the output from "([^"]*)" does not contain: |
36
- |the output from "([^"]*)" should contain "([^"]*)" |
37
- |the output from "([^"]*)" should not contain "([^"]*)" |
38
- |the output should contain "([^"]*)" |
39
- |the output should contain: |
40
- |the output should contain exactly "([^"]*)" |
41
- |the output should contain exactly: |
42
- |the output should match \/([^\/]*)\/ |
43
- |the output should match: |
44
- |the output should not contain "([^"]*)" |
45
- |the output should not contain: |
45
+ |the output contains "([^"]*)" |
46
+ |the output contains: |
47
+ |the output contains exactly "([^"]*)" |
48
+ |the output contains exactly: |
49
+ |the output does not contain "([^"]*)" |
50
+ |the output does not contain: |
51
+ |the output matches \/([^\/]*)\/ |
52
+ |the output matches: |
46
53
 
47
54
  Scenario: Command stderr
48
- Then these steps are defined for "cuken/cucumber/cmd.rb":
55
+ Then these steps are defined for "cuken/cucumber/output/stderr.rb":
49
56
  | step |
50
- |the stderr from "([^"]*)" should contain "([^"]*)" |
51
- |the stderr from "([^"]*)" should not contain "([^"]*)" |
52
- |the stderr should contain "([^"]*)" |
53
- |the stderr should contain: |
54
- |the stderr should contain exactly: |
55
- |the stderr should not contain "([^"]*)" |
56
- |the stderr should not contain: |
57
+ |the stderr from "([^"]*)" contains "([^"]*)" |
58
+ |the stderr from "([^"]*)" does not contain "([^"]*)" |
59
+ |the stderr contains "([^"]*)" |
60
+ |the stderr contains: |
61
+ |the stderr contains exactly: |
62
+ |the stderr does not contain "([^"]*)" |
63
+ |the stderr does not contain: |
57
64
 
58
65
  Scenario: Command stdout
59
- Then these steps are defined for "cuken/cucumber/cmd.rb":
66
+ Then these steps are defined for "cuken/cucumber/output/stdout.rb":
60
67
  | step |
61
- |the stdout from "([^"]*)" should contain "([^"]*)" |
62
- |the stdout from "([^"]*)" should not contain "([^"]*)" |
63
- |the stdout should contain "([^"]*)" |
64
- |the stdout should contain: |
65
- |the stdout should contain exactly: |
66
- |the stdout should not contain "([^"]*)" |
67
- |the stdout should not contain: |
68
+ |the stdout from "([^"]*)" contains "([^"]*)" |
69
+ |the stdout from "([^"]*)" does not contain "([^"]*)" |
70
+ |the stdout contains "([^"]*)" |
71
+ |the stdout contains: |
72
+ |the stdout contains exactly: |
73
+ |the stdout does not contain "([^"]*)" |
74
+ |the stdout does not contain: |
68
75
 
@@ -28,7 +28,7 @@ Feature: Examining files
28
28
 
29
29
  @steps
30
30
  Scenario: Mtime
31
- Given an empty file named "foo.file"
31
+ Given the file "foo.file" contains nothing
32
32
  And we record the a-mtime of "foo.file"
33
33
  And I run `sleep 1`
34
34
  And I run `touch -m foo.file`
@@ -36,7 +36,7 @@ Feature: Examining files
36
36
 
37
37
  @steps
38
38
  Scenario: File contents
39
- When I write to "monkeytest.file" with:
39
+ When I write to "monkeytest.file":
40
40
  """
41
41
  monkeypants
42
42
  monkeyshorts
@@ -45,7 +45,7 @@ Feature: Examining files
45
45
 
46
46
  @steps
47
47
  Scenario: File contents exact match
48
- When I write to "monkeytest.file" with:
48
+ When I write to "monkeytest.file":
49
49
  """
50
50
  monkeypants
51
51
  monkeyshorts
@@ -58,7 +58,7 @@ Feature: Examining files
58
58
 
59
59
  """
60
60
  Scenario: File contents multiple matches
61
- When I write to "monkeytest.file" with:
61
+ When I write to "monkeytest.file":
62
62
  """
63
63
  monkeypants
64
64
  monkeyshorts
@@ -80,7 +80,7 @@ Feature: Examining files
80
80
 
81
81
  @steps
82
82
  Scenario: Directory exists
83
- When I run "mkdir -p dirtest"
83
+ When I run `mkdir -p dirtest`
84
84
  Then the directory "dirtest" exists
85
85
 
86
86
  @steps
@@ -0,0 +1,33 @@
1
+ @announce @git_quick
2
+ Feature: Git cloning
3
+ In order to manage application and configuration code using Git
4
+ As an Administrator
5
+ I want to clone Git Repositories
6
+
7
+ Background:
8
+ Given a default Git repository in "ckbk/scratch/myapp"
9
+
10
+ Scenario: Clone from a Git repository
11
+ Given Explanation: Next we step up two levels to escape Aruba's working folder
12
+ And the Git repository "./../../features/data/repositories/cookbooks/hosts/.git"
13
+ When I clone the remote Git repository branch "master" to "ckbk/scratch/myapp/cookbooks/hosts"
14
+ Then the local Git repository exists
15
+
16
+ Scenario: Clone a single Repository from a Git URI
17
+ Given the Git URI "git://github.com/cookbooks/"
18
+ When I clone the Repository "hosts" branch "master" to "ckbk/scratch/myapp/cookbooks/hosts2"
19
+ Then the local Git repository exists
20
+
21
+ Scenario: Clone multiple Repositories from a Git URI
22
+ Given the Git URI "git://github.com/cookbooks/"
23
+ When I clone the Repositories:
24
+ | repo | branch | tag | ref | destination |
25
+ | hosts | | 37s.0.1.0 | | ckbk/scratch/myapp/cookbooks/hosts3 |
26
+ | users | 37s | | | ckbk/scratch/myapp/cookbooks/users |
27
+ | xml | master | | b7a11ea4eb | ckbk/scratch/myapp/cookbooks/xml |
28
+ And these local Repositories exist:
29
+ | repo |
30
+ | ckbk/scratch/myapp/cookbooks/hosts3 |
31
+ | ckbk/scratch/myapp/cookbooks/users |
32
+ | ckbk/scratch/myapp/cookbooks/xml |
33
+
@@ -14,7 +14,7 @@ Feature: Password-less SSH
14
14
 
15
15
  Scenario: Aruba steps for remote commands via password-less SSH access
16
16
  Given I successfully run "ssh cuken 'echo Supercalifragilisticexpialidocious;'"
17
- Then the output should contain "Supercalifragilisticexpialidocious"
17
+ Then the output contains "Supercalifragilisticexpialidocious"
18
18
 
19
19
  Scenario: Batch initialize password-less SSH access
20
20
  When I initialize password-less SSH access for:
@@ -23,4 +23,13 @@ Feature: Password-less SSH
23
23
  | :default | localhost | `echo cuken` | 22 |
24
24
  | :default | :default | :default | :default |
25
25
  And I successfully run `ssh cuken 'echo Supercalifragilisticexpialidocious;'`
26
- Then the output should contain "Supercalifragilisticexpialidocious"
26
+ Then the output contains "Supercalifragilisticexpialidocious"
27
+
28
+ Scenario: Initialize interactive password-less SSH access
29
+ When I interactively SSH to:
30
+ | user | hostname | name | port |
31
+ | :default | :default | :default | :default |
32
+ And I type "echo $SSH_CLIENT"
33
+ And I type "echo $SSH_CONNECTION"
34
+ Then I type "exit"
35
+ And the output contains "..."