aruba 1.1.1 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +61 -3
- data/CONTRIBUTING.md +9 -2
- data/README.md +21 -18
- data/lib/aruba/api/bundler.rb +1 -0
- data/lib/aruba/api/commands.rb +0 -2
- data/lib/aruba/api/core.rb +15 -11
- data/lib/aruba/api/filesystem.rb +1 -7
- data/lib/aruba/api/text.rb +0 -12
- data/lib/aruba/console.rb +1 -1
- data/lib/aruba/contracts/enum.rb +1 -0
- data/lib/aruba/cucumber/command.rb +175 -119
- data/lib/aruba/cucumber/file.rb +2 -2
- data/lib/aruba/cucumber/parameter_types.rb +1 -0
- data/lib/aruba/cucumber.rb +1 -0
- data/lib/aruba/event_bus/name_resolver.rb +1 -1
- data/lib/aruba/matchers/command/be_successfully_executed.rb +0 -2
- data/lib/aruba/matchers/command/have_exit_status.rb +7 -13
- data/lib/aruba/matchers/command/have_finished_in_time.rb +0 -2
- data/lib/aruba/matchers/directory/be_an_existing_directory.rb +0 -2
- data/lib/aruba/matchers/directory/have_sub_directory.rb +0 -2
- data/lib/aruba/matchers/file/be_a_command_found_in_path.rb +0 -2
- data/lib/aruba/matchers/file/be_an_existing_executable.rb +0 -1
- data/lib/aruba/matchers/file/be_an_existing_file.rb +0 -2
- data/lib/aruba/matchers/file/have_file_content.rb +0 -2
- data/lib/aruba/matchers/file/have_file_size.rb +0 -2
- data/lib/aruba/matchers/file/have_same_file_content.rb +0 -1
- data/lib/aruba/matchers/path/a_path_matching_pattern.rb +0 -2
- data/lib/aruba/matchers/path/be_an_absolute_path.rb +0 -2
- data/lib/aruba/matchers/path/be_an_existing_path.rb +0 -2
- data/lib/aruba/matchers/path/have_permissions.rb +0 -2
- data/lib/aruba/platform.rb +2 -2
- data/lib/aruba/platforms/announcer.rb +0 -2
- data/lib/aruba/platforms/command_monitor.rb +2 -2
- data/lib/aruba/platforms/unix_environment_variables.rb +0 -2
- data/lib/aruba/platforms/unix_platform.rb +2 -1
- data/lib/aruba/platforms/windows_environment_variables.rb +1 -1
- data/lib/aruba/platforms/windows_platform.rb +1 -3
- data/lib/aruba/platforms/windows_which.rb +1 -1
- data/lib/aruba/processes/basic_process.rb +4 -0
- data/lib/aruba/version.rb +1 -1
- metadata +82 -26
- data/lib/aruba/matchers/base/base_matcher.rb +0 -87
- data/lib/aruba/matchers/base/object_formatter.rb +0 -104
- data/lib/aruba/matchers/collection/all.rb +0 -11
- data/lib/aruba/matchers/collection/include_an_object.rb +0 -120
- data/lib/aruba/matchers/collection.rb +0 -1
@@ -32,108 +32,139 @@ 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
|
-
|
90
|
+
loop do
|
91
|
+
output = last_command_started.public_send :stdout, wait_for_io: 0
|
92
|
+
|
93
|
+
output = sanitize_text(output)
|
94
|
+
expected = sanitize_text(expected)
|
95
|
+
|
96
|
+
break if output.include? expected
|
97
|
+
|
94
98
|
sleep 0.1
|
95
|
-
retry
|
96
99
|
end
|
97
100
|
end
|
98
101
|
end
|
99
102
|
|
100
|
-
When
|
103
|
+
When "I wait for output/stdout to contain {string}" do |expected|
|
101
104
|
Timeout.timeout(aruba.config.exit_timeout) do
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
+
loop do
|
106
|
+
output = last_command_started.public_send :stdout, wait_for_io: 0
|
107
|
+
|
108
|
+
output = sanitize_text(output)
|
109
|
+
expected = sanitize_text(expected)
|
110
|
+
|
111
|
+
break if output.include? expected
|
112
|
+
|
105
113
|
sleep 0.1
|
106
|
-
retry
|
107
114
|
end
|
108
115
|
end
|
109
116
|
end
|
110
117
|
|
111
|
-
Then
|
118
|
+
Then "the output should be {int} bytes long" do |size|
|
112
119
|
expect(last_command_started.output).to have_output_size size.to_i
|
113
120
|
end
|
114
121
|
|
115
122
|
## the stderr should contain "hello"
|
116
|
-
Then(
|
117
|
-
do |channel, negated, exactly, expected|
|
123
|
+
Then "(the ){channel} should contain {string}" do |channel, expected|
|
118
124
|
combined_output = send("all_#{channel}")
|
119
125
|
|
120
|
-
|
121
|
-
|
122
|
-
else
|
123
|
-
:an_output_string_including
|
124
|
-
end
|
126
|
+
expect(combined_output).to include_output_string expected
|
127
|
+
end
|
125
128
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
129
|
+
## the stderr should not contain "hello"
|
130
|
+
Then "(the ){channel} should not contain {string}" do |channel, expected|
|
131
|
+
combined_output = send("all_#{channel}")
|
132
|
+
|
133
|
+
expect(combined_output).not_to include_output_string expected
|
134
|
+
end
|
135
|
+
|
136
|
+
## the stderr should contain exactly "hello"
|
137
|
+
Then "(the ){channel} should contain exactly {string}" do |channel, expected|
|
138
|
+
combined_output = send("all_#{channel}")
|
139
|
+
|
140
|
+
expect(combined_output).to output_string_eq expected
|
141
|
+
end
|
142
|
+
|
143
|
+
## the stderr should not contain exactly "hello"
|
144
|
+
Then "(the ){channel} should not contain exactly {string}" do |channel, expected|
|
145
|
+
combined_output = send("all_#{channel}")
|
146
|
+
|
147
|
+
expect(combined_output).not_to output_string_eq expected
|
131
148
|
end
|
132
149
|
|
133
150
|
## the stderr from "echo -n 'Hello'" should contain "hello"
|
134
|
-
Then(
|
135
|
-
|
136
|
-
|
151
|
+
Then "(the ){channel} from {string} should contain {string}" do |channel, cmd, expected|
|
152
|
+
matcher = case channel
|
153
|
+
when "output"; then :have_output
|
154
|
+
when "stderr"; then :have_output_on_stderr
|
155
|
+
when "stdout"; then :have_output_on_stdout
|
156
|
+
end
|
157
|
+
|
158
|
+
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
159
|
+
|
160
|
+
output_string_matcher = :an_output_string_including
|
161
|
+
|
162
|
+
expect(command).to send(matcher, send(output_string_matcher, expected))
|
163
|
+
end
|
164
|
+
|
165
|
+
## the stderr from "echo -n 'Hello'" should contain exactly "hello"
|
166
|
+
Then "(the ){channel} from {string} should contain exactly {string}" \
|
167
|
+
do |channel, cmd, expected|
|
137
168
|
matcher = case channel
|
138
169
|
when "output"; then :have_output
|
139
170
|
when "stderr"; then :have_output_on_stderr
|
@@ -142,19 +173,13 @@ Then(
|
|
142
173
|
|
143
174
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
144
175
|
|
145
|
-
output_string_matcher =
|
146
|
-
:an_output_string_being_eq
|
147
|
-
else
|
148
|
-
:an_output_string_including
|
149
|
-
end
|
176
|
+
output_string_matcher = :an_output_string_being_eq
|
150
177
|
|
151
178
|
expect(command).to send(matcher, send(output_string_matcher, expected))
|
152
179
|
end
|
153
180
|
|
154
181
|
## 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|
|
182
|
+
Then "(the ){channel} from {string} should not contain {string}" do |channel, cmd, expected|
|
158
183
|
matcher = case channel
|
159
184
|
when "output"; then :have_output
|
160
185
|
when "stderr"; then :have_output_on_stderr
|
@@ -163,46 +188,72 @@ Then(
|
|
163
188
|
|
164
189
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
165
190
|
|
166
|
-
output_string_matcher =
|
167
|
-
:an_output_string_being_eq
|
168
|
-
else
|
169
|
-
:an_output_string_including
|
170
|
-
end
|
191
|
+
output_string_matcher = :an_output_string_including
|
171
192
|
|
172
193
|
expect(command).not_to send(matcher, send(output_string_matcher, expected))
|
173
194
|
end
|
174
195
|
|
175
|
-
## the stderr should not contain exactly
|
176
|
-
Then(
|
177
|
-
do |channel,
|
196
|
+
## the stderr from "echo -n 'Hello'" should not contain exactly "hello"
|
197
|
+
Then "(the ){channel} from {string} should not contain exactly {string}" \
|
198
|
+
do |channel, cmd, expected|
|
199
|
+
matcher = case channel
|
200
|
+
when "output"; then :have_output
|
201
|
+
when "stderr"; then :have_output_on_stderr
|
202
|
+
when "stdout"; then :have_output_on_stdout
|
203
|
+
end
|
204
|
+
|
205
|
+
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
206
|
+
|
207
|
+
output_string_matcher = :an_output_string_being_eq
|
208
|
+
|
209
|
+
expect(command).not_to send(matcher, send(output_string_matcher, expected))
|
210
|
+
end
|
211
|
+
|
212
|
+
## the stderr should contain:
|
213
|
+
Then "(the ){channel} should contain:" do |channel, expected|
|
178
214
|
combined_output = send("all_#{channel}")
|
179
215
|
|
180
|
-
|
181
|
-
|
182
|
-
else
|
183
|
-
:an_output_string_including
|
184
|
-
end
|
216
|
+
expect(combined_output).to include_output_string(expected)
|
217
|
+
end
|
185
218
|
|
186
|
-
|
219
|
+
## the stderr should not contain:
|
220
|
+
Then "(the ){channel} should not contain:" do |channel, expected|
|
221
|
+
combined_output = send("all_#{channel}")
|
222
|
+
|
223
|
+
expect(combined_output).not_to include_output_string(expected)
|
187
224
|
end
|
188
225
|
|
189
226
|
## the stderr should contain exactly:
|
190
|
-
Then(
|
191
|
-
do |channel, exactly, expected|
|
227
|
+
Then "(the ){channel} should contain exactly:" do |channel, expected|
|
192
228
|
combined_output = send("all_#{channel}")
|
193
229
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
230
|
+
expect(combined_output).to output_string_eq(expected)
|
231
|
+
end
|
232
|
+
|
233
|
+
## the stderr should not contain exactly:
|
234
|
+
Then "(the ){channel} should not contain exactly:" do |channel, expected|
|
235
|
+
combined_output = send("all_#{channel}")
|
199
236
|
|
200
|
-
expect(combined_output).
|
237
|
+
expect(combined_output).not_to output_string_eq(expected)
|
238
|
+
end
|
239
|
+
|
240
|
+
## the stderr from "echo -n 'Hello'" should not contain:
|
241
|
+
Then "(the ){channel} from {string} should not contain:" do |channel, cmd, expected|
|
242
|
+
matcher = case channel
|
243
|
+
when "output"; then :have_output
|
244
|
+
when "stderr"; then :have_output_on_stderr
|
245
|
+
when "stdout"; then :have_output_on_stdout
|
246
|
+
end
|
247
|
+
|
248
|
+
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
249
|
+
|
250
|
+
output_string_matcher = :an_output_string_including
|
251
|
+
|
252
|
+
expect(command).not_to send(matcher, send(output_string_matcher, expected))
|
201
253
|
end
|
202
254
|
|
203
255
|
## the stderr from "echo -n 'Hello'" should not contain exactly:
|
204
|
-
Then(
|
205
|
-
do |channel, cmd, exactly, expected|
|
256
|
+
Then "(the ){channel} from {string} should not contain exactly:" do |channel, cmd, expected|
|
206
257
|
matcher = case channel
|
207
258
|
when "output"; then :have_output
|
208
259
|
when "stderr"; then :have_output_on_stderr
|
@@ -211,18 +262,28 @@ Then(/^(?:the )?(output|stderr|stdout) from "([^"]*)" should not contain( exactl
|
|
211
262
|
|
212
263
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
213
264
|
|
214
|
-
output_string_matcher =
|
215
|
-
:an_output_string_being_eq
|
216
|
-
else
|
217
|
-
:an_output_string_including
|
218
|
-
end
|
265
|
+
output_string_matcher = :an_output_string_being_eq
|
219
266
|
|
220
267
|
expect(command).not_to send(matcher, send(output_string_matcher, expected))
|
221
268
|
end
|
222
269
|
|
270
|
+
## the stderr from "echo -n 'Hello'" should contain:
|
271
|
+
Then "(the ){channel} from {string} should contain:" do |channel, cmd, expected|
|
272
|
+
matcher = case channel
|
273
|
+
when "output"; then :have_output
|
274
|
+
when "stderr"; then :have_output_on_stderr
|
275
|
+
when "stdout"; then :have_output_on_stdout
|
276
|
+
end
|
277
|
+
|
278
|
+
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
279
|
+
|
280
|
+
output_string_matcher = :an_output_string_including
|
281
|
+
|
282
|
+
expect(command).to send(matcher, send(output_string_matcher, expected))
|
283
|
+
end
|
284
|
+
|
223
285
|
## the stderr from "echo -n 'Hello'" should contain exactly:
|
224
|
-
Then(
|
225
|
-
do |channel, cmd, exactly, expected|
|
286
|
+
Then "(the ){channel} from {string} should contain exactly:" do |channel, cmd, expected|
|
226
287
|
matcher = case channel
|
227
288
|
when "output"; then :have_output
|
228
289
|
when "stderr"; then :have_output_on_stderr
|
@@ -231,11 +292,7 @@ Then(/^(?:the )?(output|stderr|stdout) from "([^"]*)" should contain( exactly)?:
|
|
231
292
|
|
232
293
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
233
294
|
|
234
|
-
output_string_matcher =
|
235
|
-
:an_output_string_being_eq
|
236
|
-
else
|
237
|
-
:an_output_string_including
|
238
|
-
end
|
295
|
+
output_string_matcher = :an_output_string_being_eq
|
239
296
|
|
240
297
|
expect(command).to send(matcher, send(output_string_matcher, expected))
|
241
298
|
end
|
@@ -247,35 +304,35 @@ end
|
|
247
304
|
Then(%r{^the output should( not)? match /([^/]*)/$}) do |negated, expected|
|
248
305
|
if negated
|
249
306
|
expect(all_commands)
|
250
|
-
.not_to
|
307
|
+
.not_to include have_output an_output_string_matching(expected)
|
251
308
|
else
|
252
309
|
expect(all_commands)
|
253
|
-
.to
|
310
|
+
.to include have_output an_output_string_matching(expected)
|
254
311
|
end
|
255
312
|
end
|
256
313
|
|
257
314
|
Then(/^the output should( not)? match %r<([^>]*)>$/) do |negated, expected|
|
258
315
|
if negated
|
259
316
|
expect(all_commands)
|
260
|
-
.not_to
|
317
|
+
.not_to include have_output an_output_string_matching(expected)
|
261
318
|
else
|
262
319
|
expect(all_commands)
|
263
|
-
.to
|
320
|
+
.to include have_output an_output_string_matching(expected)
|
264
321
|
end
|
265
322
|
end
|
266
323
|
|
267
324
|
Then(/^the output should( not)? match:$/) do |negated, expected|
|
268
325
|
if negated
|
269
326
|
expect(all_commands)
|
270
|
-
.not_to
|
327
|
+
.not_to include have_output an_output_string_matching(expected)
|
271
328
|
else
|
272
329
|
expect(all_commands)
|
273
|
-
.to
|
330
|
+
.to include have_output an_output_string_matching(expected)
|
274
331
|
end
|
275
332
|
end
|
276
333
|
|
277
334
|
Then(/^the exit status should( not)? be (\d+)$/) do |negated, exit_status|
|
278
|
-
last_command_started.stop if last_command_stopped.
|
335
|
+
last_command_started.stop if last_command_stopped.empty?
|
279
336
|
|
280
337
|
if negated
|
281
338
|
expect(last_command_stopped).not_to have_exit_status exit_status.to_i
|
@@ -387,7 +444,7 @@ Then(/^(?:the )?(output|stderr|stdout) should not contain anything$/) do |channe
|
|
387
444
|
when "stdout"; then :have_output_on_stdout
|
388
445
|
end
|
389
446
|
|
390
|
-
expect(all_commands).to
|
447
|
+
expect(all_commands).to include send(matcher, be_nil.or(be_empty))
|
391
448
|
end
|
392
449
|
|
393
450
|
Then(/^(?:the )?(output|stdout|stderr) should( not)? contain all of these lines:$/) \
|
@@ -403,10 +460,10 @@ Then(/^(?:the )?(output|stdout|stderr) should( not)? contain all of these lines:
|
|
403
460
|
|
404
461
|
if negated
|
405
462
|
expect(all_commands)
|
406
|
-
.not_to
|
463
|
+
.not_to include have_output an_output_string_including(expected)
|
407
464
|
else
|
408
465
|
expect(all_commands)
|
409
|
-
.to
|
466
|
+
.to include have_output an_output_string_including(expected)
|
410
467
|
end
|
411
468
|
end
|
412
469
|
end
|
@@ -419,7 +476,7 @@ Given(/^the (?:default )?aruba exit timeout is ([\d.]+) seconds?$/) do |seconds|
|
|
419
476
|
aruba.config.exit_timeout = seconds.to_f
|
420
477
|
end
|
421
478
|
|
422
|
-
Given(
|
479
|
+
Given "the( default) aruba stop signal is {string}" do |signal|
|
423
480
|
aruba.config.stop_signal = signal
|
424
481
|
end
|
425
482
|
|
@@ -427,18 +484,17 @@ Given(/^I wait ([\d.]+) seconds? for (?:a|the) command to start up$/) do |second
|
|
427
484
|
aruba.config.startup_wait_time = seconds.to_f
|
428
485
|
end
|
429
486
|
|
430
|
-
When
|
431
|
-
|
432
|
-
if
|
433
|
-
cmd = all_commands.find { |c| c.commandline == command }
|
434
|
-
raise ArgumentError, %(No command "#{command}" found) if cmd.nil?
|
487
|
+
When "I send the signal {string} to the command {string}" do |signal, command|
|
488
|
+
cmd = all_commands.find { |c| c.commandline == command }
|
489
|
+
raise ArgumentError, %(No command "#{command}" found) if cmd.nil?
|
435
490
|
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
491
|
+
cmd.send_signal signal
|
492
|
+
end
|
493
|
+
|
494
|
+
When "I send the signal {string} to the command started last" do |signal|
|
495
|
+
last_command_started.send_signal signal
|
440
496
|
end
|
441
497
|
|
442
|
-
Given
|
498
|
+
Given "I look for executables in {string} within the current directory" do |directory|
|
443
499
|
prepend_environment_variable "PATH", expand_path(directory) + File::PATH_SEPARATOR
|
444
500
|
end
|
data/lib/aruba/cucumber/file.rb
CHANGED
@@ -95,7 +95,7 @@ Then(/^the following files should (not )?exist:$/) do |negated, files|
|
|
95
95
|
if negated
|
96
96
|
expect(files).not_to include an_existing_file
|
97
97
|
else
|
98
|
-
expect(files).to
|
98
|
+
expect(files).to all be_an_existing_file
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
@@ -140,7 +140,7 @@ Then(/^the following directories should (not )?exist:$/) do |negated, directorie
|
|
140
140
|
if negated
|
141
141
|
expect(directories).not_to include an_existing_directory
|
142
142
|
else
|
143
|
-
expect(directories).to
|
143
|
+
expect(directories).to all be_an_existing_directory
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
@@ -0,0 +1 @@
|
|
1
|
+
ParameterType(name: "channel", regexp: "output|stderr|stdout", transformer: ->(name) { name })
|
data/lib/aruba/cucumber.rb
CHANGED
@@ -150,7 +150,7 @@ module Aruba
|
|
150
150
|
rescue StandardError => e
|
151
151
|
types = @resolvers.map(&:supports).flatten.join(", ")
|
152
152
|
message = "Transforming \"#{event_id}\" into an event class failed." \
|
153
|
-
|
153
|
+
" Supported types are: #{types}. #{e.message}."
|
154
154
|
raise EventNameResolveError, message, cause: e
|
155
155
|
end
|
156
156
|
end
|
@@ -18,33 +18,27 @@
|
|
18
18
|
# end
|
19
19
|
RSpec::Matchers.define :have_exit_status do |expected|
|
20
20
|
match do |actual|
|
21
|
-
|
21
|
+
actual.stop
|
22
|
+
@actual_exit_status = actual.exit_status
|
22
23
|
|
23
|
-
@
|
24
|
-
@actual = actual.exit_status
|
25
|
-
|
26
|
-
unless @old_actual.respond_to? :exit_status
|
27
|
-
raise "Expected #{@old_actual} to respond to #exit_status"
|
28
|
-
end
|
29
|
-
|
30
|
-
values_match? expected, @actual
|
24
|
+
values_match? expected, @actual_exit_status
|
31
25
|
end
|
32
26
|
|
33
27
|
failure_message do |actual|
|
34
28
|
format(
|
35
29
|
%(expected that command "%s" has exit status of "%s", but has "%s".),
|
36
|
-
|
30
|
+
actual.commandline,
|
37
31
|
expected.to_s,
|
38
|
-
|
32
|
+
@actual_exit_status.to_s
|
39
33
|
)
|
40
34
|
end
|
41
35
|
|
42
36
|
failure_message_when_negated do |actual|
|
43
37
|
format(
|
44
38
|
%(expected that command "%s" does not have exit status of "%s", but has "%s".),
|
45
|
-
|
39
|
+
actual.commandline,
|
46
40
|
expected.to_s,
|
47
|
-
|
41
|
+
@actual_exit_status.to_s
|
48
42
|
)
|
49
43
|
end
|
50
44
|
end
|
data/lib/aruba/platform.rb
CHANGED
@@ -5,10 +5,10 @@ require "aruba/platforms/windows_platform"
|
|
5
5
|
module Aruba
|
6
6
|
PLATFORM_MUTEX = Mutex.new
|
7
7
|
|
8
|
-
|
8
|
+
PLATFORM = [Platforms::WindowsPlatform, Platforms::UnixPlatform].find(&:match?)
|
9
9
|
|
10
10
|
PLATFORM_MUTEX.synchronize do
|
11
|
-
@platform =
|
11
|
+
@platform = PLATFORM.new
|
12
12
|
end
|
13
13
|
|
14
14
|
class << self
|