aruba 1.0.4 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +60 -2
- data/CONTRIBUTING.md +18 -22
- data/README.md +13 -18
- data/exe/aruba +2 -2
- data/lib/aruba.rb +1 -1
- data/lib/aruba/api.rb +11 -11
- data/lib/aruba/api/bundler.rb +2 -1
- data/lib/aruba/api/commands.rb +7 -7
- data/lib/aruba/api/core.rb +33 -29
- data/lib/aruba/api/environment.rb +2 -2
- data/lib/aruba/api/filesystem.rb +35 -14
- data/lib/aruba/api/text.rb +4 -4
- data/lib/aruba/aruba_path.rb +2 -2
- data/lib/aruba/basic_configuration.rb +11 -11
- data/lib/aruba/cli.rb +7 -7
- data/lib/aruba/command.rb +4 -4
- data/lib/aruba/config/jruby.rb +9 -9
- data/lib/aruba/config_wrapper.rb +2 -2
- data/lib/aruba/configuration.rb +14 -14
- data/lib/aruba/console.rb +11 -11
- data/lib/aruba/console/help.rb +5 -5
- data/lib/aruba/contracts/absolute_path.rb +1 -1
- data/lib/aruba/contracts/enum.rb +1 -1
- data/lib/aruba/contracts/is_power_of_two.rb +1 -1
- data/lib/aruba/contracts/relative_path.rb +1 -1
- data/lib/aruba/cucumber.rb +8 -7
- data/lib/aruba/cucumber/command.rb +187 -143
- data/lib/aruba/cucumber/environment.rb +7 -7
- data/lib/aruba/cucumber/file.rb +7 -3
- data/lib/aruba/cucumber/hooks.rb +29 -29
- data/lib/aruba/cucumber/parameter_types.rb +1 -0
- data/lib/aruba/cucumber/testing_frameworks.rb +18 -18
- data/lib/aruba/event_bus.rb +4 -4
- data/lib/aruba/event_bus/name_resolver.rb +5 -5
- data/lib/aruba/file_size.rb +1 -1
- data/lib/aruba/generators/script_file.rb +2 -2
- data/lib/aruba/in_config_wrapper.rb +1 -1
- data/lib/aruba/initializer.rb +10 -10
- data/lib/aruba/matchers/base/base_matcher.rb +1 -1
- data/lib/aruba/matchers/base/message_indenter.rb +1 -1
- data/lib/aruba/matchers/base/object_formatter.rb +2 -2
- data/lib/aruba/matchers/collection.rb +1 -1
- data/lib/aruba/matchers/collection/all.rb +1 -1
- data/lib/aruba/matchers/collection/include_an_object.rb +2 -2
- data/lib/aruba/matchers/command.rb +1 -1
- data/lib/aruba/matchers/command/be_successfully_executed.rb +4 -4
- data/lib/aruba/matchers/command/have_finished_in_time.rb +1 -1
- data/lib/aruba/matchers/command/have_output.rb +1 -1
- data/lib/aruba/matchers/directory.rb +1 -1
- data/lib/aruba/matchers/directory/be_an_existing_directory.rb +2 -2
- data/lib/aruba/matchers/directory/have_sub_directory.rb +3 -3
- data/lib/aruba/matchers/environment.rb +1 -1
- data/lib/aruba/matchers/file.rb +1 -1
- data/lib/aruba/matchers/file/be_a_command_found_in_path.rb +1 -1
- data/lib/aruba/matchers/file/be_an_existing_executable.rb +2 -2
- data/lib/aruba/matchers/file/be_an_existing_file.rb +2 -2
- data/lib/aruba/matchers/file/have_file_content.rb +1 -1
- data/lib/aruba/matchers/file/have_file_size.rb +1 -1
- data/lib/aruba/matchers/file/have_same_file_content.rb +2 -2
- data/lib/aruba/matchers/path.rb +1 -1
- data/lib/aruba/matchers/path/a_path_matching_pattern.rb +1 -1
- data/lib/aruba/matchers/path/be_an_absolute_path.rb +1 -1
- data/lib/aruba/matchers/path/be_an_existing_path.rb +1 -1
- data/lib/aruba/matchers/path/have_permissions.rb +2 -2
- data/lib/aruba/matchers/string.rb +1 -1
- data/lib/aruba/matchers/string/include_output_string.rb +1 -1
- data/lib/aruba/matchers/string/match_output_string.rb +1 -1
- data/lib/aruba/matchers/string/output_string_eq.rb +1 -1
- data/lib/aruba/platform.rb +2 -2
- data/lib/aruba/platforms/announcer.rb +14 -14
- data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +1 -1
- data/lib/aruba/platforms/aruba_logger.rb +1 -1
- data/lib/aruba/platforms/command_monitor.rb +5 -5
- data/lib/aruba/platforms/determine_disk_usage.rb +1 -1
- data/lib/aruba/platforms/filesystem_status.rb +1 -1
- data/lib/aruba/platforms/simple_table.rb +1 -1
- data/lib/aruba/platforms/unix_command_string.rb +2 -2
- data/lib/aruba/platforms/unix_platform.rb +23 -23
- data/lib/aruba/platforms/unix_which.rb +1 -1
- data/lib/aruba/platforms/windows_command_string.rb +2 -2
- data/lib/aruba/platforms/windows_environment_variables.rb +2 -2
- data/lib/aruba/platforms/windows_platform.rb +6 -8
- data/lib/aruba/platforms/windows_which.rb +5 -5
- data/lib/aruba/processes/basic_process.rb +2 -2
- data/lib/aruba/processes/debug_process.rb +5 -5
- data/lib/aruba/processes/in_process.rb +7 -7
- data/lib/aruba/processes/spawn_process.rb +17 -22
- data/lib/aruba/rspec.rb +6 -6
- data/lib/aruba/runtime.rb +6 -6
- data/lib/aruba/setup.rb +3 -3
- data/lib/aruba/version.rb +1 -1
- metadata +75 -29
- data/lib/aruba/tasks/docker_helpers.rb +0 -156
data/lib/aruba/contracts/enum.rb
CHANGED
data/lib/aruba/cucumber.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
require
|
1
|
+
require "aruba/version"
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
3
|
+
require "aruba/api"
|
4
|
+
require "aruba/cucumber/hooks"
|
5
|
+
require "aruba/cucumber/parameter_types"
|
6
|
+
require "aruba/cucumber/command"
|
7
|
+
require "aruba/cucumber/environment"
|
8
|
+
require "aruba/cucumber/file"
|
9
|
+
require "aruba/cucumber/testing_frameworks"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "aruba/generators/script_file"
|
2
2
|
|
3
3
|
When(/^I run `([^`]*)`$/) do |cmd|
|
4
4
|
cmd = sanitize_text(cmd)
|
@@ -14,9 +14,9 @@ end
|
|
14
14
|
|
15
15
|
When(/^I run the following (?:commands|script)(?: (?:with|in) `([^`]+)`)?:$/) \
|
16
16
|
do |shell, commands|
|
17
|
-
full_path = expand_path(
|
17
|
+
full_path = expand_path("bin/myscript")
|
18
18
|
|
19
|
-
Aruba.platform.mkdir(expand_path(
|
19
|
+
Aruba.platform.mkdir(expand_path("bin"))
|
20
20
|
shell ||= Aruba.platform.default_shell
|
21
21
|
|
22
22
|
Aruba::ScriptFile.new(interpreter: shell, content: commands, path: full_path).call
|
@@ -32,210 +32,255 @@ When(/^I run `([^`]*)` in background$/) do |cmd|
|
|
32
32
|
run_command(sanitize_text(cmd))
|
33
33
|
end
|
34
34
|
|
35
|
-
When
|
35
|
+
When "I type {string}" do |input|
|
36
36
|
type(unescape_text(input))
|
37
37
|
end
|
38
38
|
|
39
|
-
When
|
39
|
+
When "I close the stdin stream" do
|
40
40
|
close_input
|
41
41
|
end
|
42
42
|
|
43
|
-
When
|
43
|
+
When "I pipe in a/the file( named) {string}" do |file|
|
44
44
|
pipe_in_file(file)
|
45
45
|
|
46
46
|
close_input
|
47
47
|
end
|
48
48
|
|
49
|
-
When
|
50
|
-
|
49
|
+
When "I stop the command started last" do
|
50
|
+
last_command_started.stop
|
51
|
+
end
|
51
52
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
last_command_started
|
56
|
-
end
|
53
|
+
When "I stop the command {string}" do |command|
|
54
|
+
aruba.command_monitor.find(command).stop
|
55
|
+
end
|
57
56
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
57
|
+
When "I terminate the command started last" do
|
58
|
+
last_command_started.terminate
|
59
|
+
end
|
60
|
+
|
61
|
+
When "I terminate the command {string}" do |command|
|
62
|
+
aruba.command_monitor.find(command).terminate
|
63
63
|
end
|
64
64
|
|
65
65
|
When(/^I stop the command(?: started last)? if (output|stdout|stderr) contains:$/) \
|
66
66
|
do |channel, expected|
|
67
|
-
begin
|
68
|
-
Timeout.timeout(aruba.config.exit_timeout) do
|
69
|
-
loop do
|
70
|
-
output = last_command_started.public_send channel.to_sym, wait_for_io: 0
|
71
67
|
|
72
|
-
|
73
|
-
|
68
|
+
Timeout.timeout(aruba.config.exit_timeout) do
|
69
|
+
loop do
|
70
|
+
output = last_command_started.public_send channel.to_sym, wait_for_io: 0
|
74
71
|
|
75
|
-
|
76
|
-
|
72
|
+
output = sanitize_text(output)
|
73
|
+
expected = sanitize_text(expected)
|
77
74
|
|
78
|
-
|
79
|
-
|
75
|
+
if output.include? expected
|
76
|
+
last_command_started.terminate
|
80
77
|
|
81
|
-
|
78
|
+
break
|
82
79
|
end
|
80
|
+
|
81
|
+
sleep 0.1
|
83
82
|
end
|
84
|
-
rescue ChildProcess::TimeoutError, Timeout::Error
|
85
|
-
last_command_started.terminate
|
86
83
|
end
|
84
|
+
rescue ChildProcess::TimeoutError, Timeout::Error
|
85
|
+
last_command_started.terminate
|
87
86
|
end
|
88
87
|
|
89
|
-
When
|
88
|
+
When "I wait for output/stdout to contain" do |expected|
|
90
89
|
Timeout.timeout(aruba.config.exit_timeout) do
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
retry
|
96
|
-
end
|
90
|
+
expect(last_command_started).to have_output an_output_string_including(expected)
|
91
|
+
rescue ExpectationError
|
92
|
+
sleep 0.1
|
93
|
+
retry
|
97
94
|
end
|
98
95
|
end
|
99
96
|
|
100
|
-
When
|
97
|
+
When "I wait for output/stdout to contain {string}" do |expected|
|
101
98
|
Timeout.timeout(aruba.config.exit_timeout) do
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
retry
|
107
|
-
end
|
99
|
+
expect(last_command_started).to have_output an_output_string_including(expected)
|
100
|
+
rescue ExpectationError
|
101
|
+
sleep 0.1
|
102
|
+
retry
|
108
103
|
end
|
109
104
|
end
|
110
105
|
|
111
|
-
Then
|
106
|
+
Then "the output should be {int} bytes long" do |size|
|
112
107
|
expect(last_command_started.output).to have_output_size size.to_i
|
113
108
|
end
|
114
109
|
|
115
110
|
## the stderr should contain "hello"
|
116
|
-
Then(
|
117
|
-
do |channel, negated, exactly, expected|
|
111
|
+
Then "(the ){channel} should contain {string}" do |channel, expected|
|
118
112
|
combined_output = send("all_#{channel}")
|
119
113
|
|
120
|
-
|
121
|
-
|
122
|
-
else
|
123
|
-
:an_output_string_including
|
124
|
-
end
|
114
|
+
expect(combined_output).to include_output_string expected
|
115
|
+
end
|
125
116
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
117
|
+
## the stderr should not contain "hello"
|
118
|
+
Then "(the ){channel} should not contain {string}" do |channel, expected|
|
119
|
+
combined_output = send("all_#{channel}")
|
120
|
+
|
121
|
+
expect(combined_output).not_to include_output_string expected
|
122
|
+
end
|
123
|
+
|
124
|
+
## the stderr should contain exactly "hello"
|
125
|
+
Then "(the ){channel} should contain exactly {string}" do |channel, expected|
|
126
|
+
combined_output = send("all_#{channel}")
|
127
|
+
|
128
|
+
expect(combined_output).to output_string_eq expected
|
129
|
+
end
|
130
|
+
|
131
|
+
## the stderr should not contain exactly "hello"
|
132
|
+
Then "(the ){channel} should not contain exactly {string}" do |channel, expected|
|
133
|
+
combined_output = send("all_#{channel}")
|
134
|
+
|
135
|
+
expect(combined_output).not_to output_string_eq expected
|
131
136
|
end
|
132
137
|
|
133
138
|
## the stderr from "echo -n 'Hello'" should contain "hello"
|
134
|
-
Then(
|
135
|
-
/^(?:the )?(output|stderr|stdout) from "([^"]*)" should contain( exactly)? "([^"]*)"$/
|
136
|
-
) do |channel, cmd, exactly, expected|
|
139
|
+
Then "(the ){channel} from {string} should contain {string}" do |channel, cmd, expected|
|
137
140
|
matcher = case channel
|
138
|
-
when
|
139
|
-
when
|
140
|
-
when
|
141
|
+
when "output"; then :have_output
|
142
|
+
when "stderr"; then :have_output_on_stderr
|
143
|
+
when "stdout"; then :have_output_on_stdout
|
141
144
|
end
|
142
145
|
|
143
146
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
144
147
|
|
145
|
-
output_string_matcher =
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
148
|
+
output_string_matcher = :an_output_string_including
|
149
|
+
|
150
|
+
expect(command).to send(matcher, send(output_string_matcher, expected))
|
151
|
+
end
|
152
|
+
|
153
|
+
## the stderr from "echo -n 'Hello'" should contain exactly "hello"
|
154
|
+
Then "(the ){channel} from {string} should contain exactly {string}" \
|
155
|
+
do |channel, cmd, expected|
|
156
|
+
matcher = case channel
|
157
|
+
when "output"; then :have_output
|
158
|
+
when "stderr"; then :have_output_on_stderr
|
159
|
+
when "stdout"; then :have_output_on_stdout
|
160
|
+
end
|
161
|
+
|
162
|
+
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
163
|
+
|
164
|
+
output_string_matcher = :an_output_string_being_eq
|
150
165
|
|
151
166
|
expect(command).to send(matcher, send(output_string_matcher, expected))
|
152
167
|
end
|
153
168
|
|
154
169
|
## the stderr from "echo -n 'Hello'" should not contain "hello"
|
155
|
-
Then(
|
156
|
-
/^(?:the )?(output|stderr|stdout) from "([^"]*)" should not contain( exactly)? "([^"]*)"$/
|
157
|
-
) do |channel, cmd, exactly, expected|
|
170
|
+
Then "(the ){channel} from {string} should not contain {string}" do |channel, cmd, expected|
|
158
171
|
matcher = case channel
|
159
|
-
when
|
160
|
-
when
|
161
|
-
when
|
172
|
+
when "output"; then :have_output
|
173
|
+
when "stderr"; then :have_output_on_stderr
|
174
|
+
when "stdout"; then :have_output_on_stdout
|
162
175
|
end
|
163
176
|
|
164
177
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
165
178
|
|
166
|
-
output_string_matcher =
|
167
|
-
:an_output_string_being_eq
|
168
|
-
else
|
169
|
-
:an_output_string_including
|
170
|
-
end
|
179
|
+
output_string_matcher = :an_output_string_including
|
171
180
|
|
172
181
|
expect(command).not_to send(matcher, send(output_string_matcher, expected))
|
173
182
|
end
|
174
183
|
|
175
|
-
## the stderr should not contain exactly
|
176
|
-
Then(
|
177
|
-
do |channel,
|
184
|
+
## the stderr from "echo -n 'Hello'" should not contain exactly "hello"
|
185
|
+
Then "(the ){channel} from {string} should not contain exactly {string}" \
|
186
|
+
do |channel, cmd, expected|
|
187
|
+
matcher = case channel
|
188
|
+
when "output"; then :have_output
|
189
|
+
when "stderr"; then :have_output_on_stderr
|
190
|
+
when "stdout"; then :have_output_on_stdout
|
191
|
+
end
|
192
|
+
|
193
|
+
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
194
|
+
|
195
|
+
output_string_matcher = :an_output_string_being_eq
|
196
|
+
|
197
|
+
expect(command).not_to send(matcher, send(output_string_matcher, expected))
|
198
|
+
end
|
199
|
+
|
200
|
+
## the stderr should contain:
|
201
|
+
Then "(the ){channel} should contain:" do |channel, expected|
|
178
202
|
combined_output = send("all_#{channel}")
|
179
203
|
|
180
|
-
|
181
|
-
|
182
|
-
else
|
183
|
-
:an_output_string_including
|
184
|
-
end
|
204
|
+
expect(combined_output).to include_output_string(expected)
|
205
|
+
end
|
185
206
|
|
186
|
-
|
207
|
+
## the stderr should not contain:
|
208
|
+
Then "(the ){channel} should not contain:" do |channel, expected|
|
209
|
+
combined_output = send("all_#{channel}")
|
210
|
+
|
211
|
+
expect(combined_output).not_to include_output_string(expected)
|
187
212
|
end
|
188
213
|
|
189
214
|
## the stderr should contain exactly:
|
190
|
-
Then(
|
191
|
-
do |channel, exactly, expected|
|
215
|
+
Then "(the ){channel} should contain exactly:" do |channel, expected|
|
192
216
|
combined_output = send("all_#{channel}")
|
193
217
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
218
|
+
expect(combined_output).to output_string_eq(expected)
|
219
|
+
end
|
220
|
+
|
221
|
+
## the stderr should not contain exactly:
|
222
|
+
Then "(the ){channel} should not contain exactly:" do |channel, expected|
|
223
|
+
combined_output = send("all_#{channel}")
|
224
|
+
|
225
|
+
expect(combined_output).not_to output_string_eq(expected)
|
226
|
+
end
|
227
|
+
|
228
|
+
## the stderr from "echo -n 'Hello'" should not contain:
|
229
|
+
Then "(the ){channel} from {string} should not contain:" do |channel, cmd, expected|
|
230
|
+
matcher = case channel
|
231
|
+
when "output"; then :have_output
|
232
|
+
when "stderr"; then :have_output_on_stderr
|
233
|
+
when "stdout"; then :have_output_on_stdout
|
234
|
+
end
|
235
|
+
|
236
|
+
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
237
|
+
|
238
|
+
output_string_matcher = :an_output_string_including
|
199
239
|
|
200
|
-
expect(
|
240
|
+
expect(command).not_to send(matcher, send(output_string_matcher, expected))
|
201
241
|
end
|
202
242
|
|
203
243
|
## the stderr from "echo -n 'Hello'" should not contain exactly:
|
204
|
-
Then(
|
205
|
-
do |channel, cmd, exactly, expected|
|
244
|
+
Then "(the ){channel} from {string} should not contain exactly:" do |channel, cmd, expected|
|
206
245
|
matcher = case channel
|
207
|
-
when
|
208
|
-
when
|
209
|
-
when
|
246
|
+
when "output"; then :have_output
|
247
|
+
when "stderr"; then :have_output_on_stderr
|
248
|
+
when "stdout"; then :have_output_on_stdout
|
210
249
|
end
|
211
250
|
|
212
251
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
213
252
|
|
214
|
-
output_string_matcher =
|
215
|
-
:an_output_string_being_eq
|
216
|
-
else
|
217
|
-
:an_output_string_including
|
218
|
-
end
|
253
|
+
output_string_matcher = :an_output_string_being_eq
|
219
254
|
|
220
255
|
expect(command).not_to send(matcher, send(output_string_matcher, expected))
|
221
256
|
end
|
222
257
|
|
258
|
+
## the stderr from "echo -n 'Hello'" should contain:
|
259
|
+
Then "(the ){channel} from {string} should contain:" do |channel, cmd, expected|
|
260
|
+
matcher = case channel
|
261
|
+
when "output"; then :have_output
|
262
|
+
when "stderr"; then :have_output_on_stderr
|
263
|
+
when "stdout"; then :have_output_on_stdout
|
264
|
+
end
|
265
|
+
|
266
|
+
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
267
|
+
|
268
|
+
output_string_matcher = :an_output_string_including
|
269
|
+
|
270
|
+
expect(command).to send(matcher, send(output_string_matcher, expected))
|
271
|
+
end
|
272
|
+
|
223
273
|
## the stderr from "echo -n 'Hello'" should contain exactly:
|
224
|
-
Then(
|
225
|
-
do |channel, cmd, exactly, expected|
|
274
|
+
Then "(the ){channel} from {string} should contain exactly:" do |channel, cmd, expected|
|
226
275
|
matcher = case channel
|
227
|
-
when
|
228
|
-
when
|
229
|
-
when
|
276
|
+
when "output"; then :have_output
|
277
|
+
when "stderr"; then :have_output_on_stderr
|
278
|
+
when "stdout"; then :have_output_on_stdout
|
230
279
|
end
|
231
280
|
|
232
281
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
233
282
|
|
234
|
-
output_string_matcher =
|
235
|
-
:an_output_string_being_eq
|
236
|
-
else
|
237
|
-
:an_output_string_including
|
238
|
-
end
|
283
|
+
output_string_matcher = :an_output_string_being_eq
|
239
284
|
|
240
285
|
expect(command).to send(matcher, send(output_string_matcher, expected))
|
241
286
|
end
|
@@ -287,7 +332,7 @@ end
|
|
287
332
|
Then(/^it should not (pass|fail) with "(.*?)"$/) do |pass_fail, expected|
|
288
333
|
last_command_started.stop
|
289
334
|
|
290
|
-
if pass_fail ==
|
335
|
+
if pass_fail == "pass"
|
291
336
|
expect(last_command_stopped).to be_successfully_executed
|
292
337
|
else
|
293
338
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -299,7 +344,7 @@ end
|
|
299
344
|
Then(/^it should (pass|fail) with "(.*?)"$/) do |pass_fail, expected|
|
300
345
|
last_command_started.stop
|
301
346
|
|
302
|
-
if pass_fail ==
|
347
|
+
if pass_fail == "pass"
|
303
348
|
expect(last_command_stopped).to be_successfully_executed
|
304
349
|
else
|
305
350
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -311,7 +356,7 @@ end
|
|
311
356
|
Then(/^it should not (pass|fail) with:$/) do |pass_fail, expected|
|
312
357
|
last_command_started.stop
|
313
358
|
|
314
|
-
if pass_fail ==
|
359
|
+
if pass_fail == "pass"
|
315
360
|
expect(last_command_stopped).to be_successfully_executed
|
316
361
|
else
|
317
362
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -323,7 +368,7 @@ end
|
|
323
368
|
Then(/^it should (pass|fail) with:$/) do |pass_fail, expected|
|
324
369
|
last_command_started.stop
|
325
370
|
|
326
|
-
if pass_fail ==
|
371
|
+
if pass_fail == "pass"
|
327
372
|
expect(last_command_stopped).to be_successfully_executed
|
328
373
|
else
|
329
374
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -335,7 +380,7 @@ end
|
|
335
380
|
Then(/^it should not (pass|fail) with exactly:$/) do |pass_fail, expected|
|
336
381
|
last_command_started.stop
|
337
382
|
|
338
|
-
if pass_fail ==
|
383
|
+
if pass_fail == "pass"
|
339
384
|
expect(last_command_stopped).to be_successfully_executed
|
340
385
|
else
|
341
386
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -347,7 +392,7 @@ end
|
|
347
392
|
Then(/^it should (pass|fail) with exactly:$/) do |pass_fail, expected|
|
348
393
|
last_command_started.stop
|
349
394
|
|
350
|
-
if pass_fail ==
|
395
|
+
if pass_fail == "pass"
|
351
396
|
expect(last_command_stopped).to be_successfully_executed
|
352
397
|
else
|
353
398
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -359,7 +404,7 @@ end
|
|
359
404
|
Then(/^it should not (pass|fail) (?:with regexp?|matching):$/) do |pass_fail, expected|
|
360
405
|
last_command_started.stop
|
361
406
|
|
362
|
-
if pass_fail ==
|
407
|
+
if pass_fail == "pass"
|
363
408
|
expect(last_command_stopped).to be_successfully_executed
|
364
409
|
else
|
365
410
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -371,7 +416,7 @@ end
|
|
371
416
|
Then(/^it should (pass|fail) (?:with regexp?|matching):$/) do |pass_fail, expected|
|
372
417
|
last_command_started.stop
|
373
418
|
|
374
|
-
if pass_fail ==
|
419
|
+
if pass_fail == "pass"
|
375
420
|
expect(last_command_stopped).to be_successfully_executed
|
376
421
|
else
|
377
422
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -382,9 +427,9 @@ end
|
|
382
427
|
|
383
428
|
Then(/^(?:the )?(output|stderr|stdout) should not contain anything$/) do |channel|
|
384
429
|
matcher = case channel
|
385
|
-
when
|
386
|
-
when
|
387
|
-
when
|
430
|
+
when "output"; then :have_output
|
431
|
+
when "stderr"; then :have_output_on_stderr
|
432
|
+
when "stdout"; then :have_output_on_stdout
|
388
433
|
end
|
389
434
|
|
390
435
|
expect(all_commands).to include_an_object send(matcher, be_nil.or(be_empty))
|
@@ -394,9 +439,9 @@ Then(/^(?:the )?(output|stdout|stderr) should( not)? contain all of these lines:
|
|
394
439
|
do |channel, negated, table|
|
395
440
|
table.raw.flatten.each do |expected|
|
396
441
|
_matcher = case channel
|
397
|
-
when
|
398
|
-
when
|
399
|
-
when
|
442
|
+
when "output"; then :have_output
|
443
|
+
when "stderr"; then :have_output_on_stderr
|
444
|
+
when "stdout"; then :have_output_on_stdout
|
400
445
|
end
|
401
446
|
|
402
447
|
# TODO: This isn't actually using the above. It's hardcoded to use have_output only
|
@@ -419,7 +464,7 @@ Given(/^the (?:default )?aruba exit timeout is ([\d.]+) seconds?$/) do |seconds|
|
|
419
464
|
aruba.config.exit_timeout = seconds.to_f
|
420
465
|
end
|
421
466
|
|
422
|
-
Given(
|
467
|
+
Given "the( default) aruba stop signal is {string}" do |signal|
|
423
468
|
aruba.config.stop_signal = signal
|
424
469
|
end
|
425
470
|
|
@@ -427,18 +472,17 @@ Given(/^I wait ([\d.]+) seconds? for (?:a|the) command to start up$/) do |second
|
|
427
472
|
aruba.config.startup_wait_time = seconds.to_f
|
428
473
|
end
|
429
474
|
|
430
|
-
When
|
431
|
-
|
432
|
-
if
|
433
|
-
cmd = all_commands.find { |c| c.commandline == command }
|
434
|
-
raise ArgumentError, %(No command "#{command}" found) if cmd.nil?
|
475
|
+
When "I send the signal {string} to the command {string}" do |signal, command|
|
476
|
+
cmd = all_commands.find { |c| c.commandline == command }
|
477
|
+
raise ArgumentError, %(No command "#{command}" found) if cmd.nil?
|
435
478
|
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
479
|
+
cmd.send_signal signal
|
480
|
+
end
|
481
|
+
|
482
|
+
When "I send the signal {string} to the command started last" do |signal|
|
483
|
+
last_command_started.send_signal signal
|
440
484
|
end
|
441
485
|
|
442
|
-
Given
|
443
|
-
prepend_environment_variable
|
486
|
+
Given "I look for executables in {string} within the current directory" do |directory|
|
487
|
+
prepend_environment_variable "PATH", expand_path(directory) + File::PATH_SEPARATOR
|
444
488
|
end
|