aruba 0.14.7 → 0.14.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/Gemfile +8 -0
- data/History.md +9 -0
- data/README.md +0 -1
- data/Rakefile +4 -3
- data/aruba.gemspec +1 -1
- data/features/api/command/find_command.feature +5 -5
- data/features/api/command/last_command_started.feature +3 -3
- data/features/api/command/last_command_stopped.feature +6 -6
- data/features/api/command/run.feature +22 -22
- data/features/api/command/run_simple.feature +12 -12
- data/features/api/command/send_signal.feature +2 -2
- data/features/api/command/stderr.feature +2 -2
- data/features/api/command/stdout.feature +2 -2
- data/features/api/command/stop.feature +4 -4
- data/features/api/command/stop_all_commands.feature +5 -5
- data/features/api/command/terminate_all_commands.feature +5 -5
- data/features/api/environment/append_environment_variable.feature +5 -5
- data/features/api/environment/delete_environment_variable.feature +3 -3
- data/features/api/environment/prepend_environment_variable.feature +6 -6
- data/features/api/environment/set_environment_variable.feature +15 -15
- data/features/api/filesystem/cd.feature +2 -2
- data/features/api/text/extract_text.feature +4 -4
- data/features/api/text/replace_variables.feature +1 -1
- data/features/api/text/sanitize_text.feature +11 -11
- data/features/api/text/unescape_text.feature +6 -6
- data/features/configuration/command_runtime_environment.feature +5 -5
- data/features/configuration/usage.feature +5 -5
- data/features/hooks/after/command.feature +1 -1
- data/features/hooks/before/command.feature +2 -2
- data/features/matchers/timeouts.feature +2 -2
- data/features/step_definitions/aruba_dev_steps.rb +1 -1
- data/lib/aruba/api.rb +1 -1
- data/lib/aruba/api/{command.rb → commands.rb} +10 -9
- data/lib/aruba/api/deprecated.rb +65 -7
- data/lib/aruba/api/rvm.rb +3 -3
- data/lib/aruba/basic_configuration.rb +0 -2
- data/lib/aruba/config.rb +0 -1
- data/lib/aruba/console.rb +0 -2
- data/lib/aruba/cucumber/command.rb +6 -6
- data/lib/aruba/generators/script_file.rb +1 -1
- data/lib/aruba/matchers/deprecated/file.rb +3 -1
- data/lib/aruba/platforms/command_monitor.rb +0 -5
- data/lib/aruba/platforms/unix_environment_variables.rb +1 -3
- data/lib/aruba/platforms/unix_which.rb +0 -4
- data/lib/aruba/platforms/windows_which.rb +0 -4
- data/lib/aruba/processes/basic_process.rb +1 -0
- data/lib/aruba/processes/spawn_process.rb +1 -3
- data/lib/aruba/runtime.rb +4 -3
- data/lib/aruba/version.rb +1 -1
- data/spec/aruba/api/deprecated_spec.rb +5 -5
- data/spec/aruba/api_spec.rb +7 -7
- data/spec/aruba/matchers/command_spec.rb +18 -18
- data/spec/aruba/matchers/deprecated_spec.rb +1 -2
- data/spec/aruba/matchers/file_spec.rb +1 -2
- data/spec/event_bus_spec.rb +0 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e721e1228e9ab5f000571f0acf6c25a98e90d449d18e48240f1194963fb7314
|
4
|
+
data.tar.gz: 84ded1fc93c5c0b2c208f15703fbc76084fca287868eb91d06a473fc964b35d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0da00e29ba8466a005392a5621f122225f3cc43539276b96de1cda4c7b414c73375f27473b415862de22fd12b13b49573f4c6e73c3d15be924867175717b5854
|
7
|
+
data.tar.gz: d611e3e1d0594b0bc982ccbbc09c7685112197fb28324002114b2ffd0b24d636b47c2b91e0d5999dd60d41256e447c982db4b6e53ebc47adf58edfe64e87c1dc
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
@@ -58,6 +58,14 @@ group :development, :test do
|
|
58
58
|
|
59
59
|
# Reporting
|
60
60
|
gem 'bcat', '~> 0.6.2'
|
61
|
+
end
|
62
|
+
|
63
|
+
# YARD documentation
|
64
|
+
if RUBY_VERSION >= '2.3.0'
|
65
|
+
gem 'yard', '~> 0.9.11'
|
66
|
+
gem 'kramdown', '~> 2.1'
|
67
|
+
elsif RUBY_VERSION >= '2.0.0'
|
68
|
+
gem 'yard', '~> 0.9.11'
|
61
69
|
gem 'kramdown', '~> 1.7.0'
|
62
70
|
end
|
63
71
|
|
data/History.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
# RELEASED
|
4
4
|
|
5
|
+
## [v0.14.8](https://github.com/cucumber/aruba/compare/v0.14.7...v0.14.8)
|
6
|
+
|
7
|
+
* Deprecate `#run` and `#run_simple` in favor of `#run_command` and
|
8
|
+
`#run_command_and_stop` (#585)
|
9
|
+
* Update dependencies, most notably loosening the dependency on `childprocess`
|
10
|
+
(#591)
|
11
|
+
* Properly warn about deprecated use of the run methods with one positional
|
12
|
+
option (#588)
|
13
|
+
|
5
14
|
## [v0.14.7](https://github.com/cucumber/aruba/compare/v0.14.6...v0.14.7)
|
6
15
|
|
7
16
|
* Fix Cucumber steps to use `have_same_file_content_as` matcher (#572)
|
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
[](http://badge.fury.io/rb/aruba)
|
2
|
-
[](https://gemnasium.com/cucumber/aruba)
|
3
2
|
[](https://codeclimate.com/github/cucumber/aruba)
|
4
3
|
[](https://gitter.im/cucumber/aruba?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
5
4
|
|
data/Rakefile
CHANGED
@@ -36,9 +36,10 @@ namespace :travis do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
task :rubocop do
|
39
|
-
|
40
|
-
sh 'rubocop --fail-level E'
|
41
|
-
|
39
|
+
if RUBY_VERSION >= '2'
|
40
|
+
sh 'bundle exec rubocop --fail-level E'
|
41
|
+
else
|
42
|
+
warn 'Your ruby version is not supported for code linting'
|
42
43
|
end
|
43
44
|
end
|
44
45
|
|
data/aruba.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.homepage = 'http://github.com/cucumber/aruba'
|
15
15
|
|
16
16
|
s.add_runtime_dependency 'cucumber', '>= 1.3.19'
|
17
|
-
s.add_runtime_dependency 'childprocess', ['>= 0.6.3', '<
|
17
|
+
s.add_runtime_dependency 'childprocess', ['>= 0.6.3', '< 1.1.0']
|
18
18
|
s.add_runtime_dependency 'ffi', '~> 1.9'
|
19
19
|
s.add_runtime_dependency 'rspec-expectations', '>= 2.99'
|
20
20
|
s.add_runtime_dependency 'contracts', '~> 0.9'
|
@@ -11,7 +11,7 @@ Feature: Find a started command
|
|
11
11
|
require 'spec_helper'
|
12
12
|
|
13
13
|
RSpec.describe 'Run command', :type => :aruba do
|
14
|
-
before(:each) {
|
14
|
+
before(:each) { run_command('echo hello') }
|
15
15
|
let(:command) { find_command('echo hello') }
|
16
16
|
|
17
17
|
before(:each) { stop_all_commands }
|
@@ -44,8 +44,8 @@ Feature: Find a started command
|
|
44
44
|
require 'spec_helper'
|
45
45
|
|
46
46
|
RSpec.describe 'Run command', :type => :aruba do
|
47
|
-
before(:each) {
|
48
|
-
before(:each) {
|
47
|
+
before(:each) { run_command('echo hello1') }
|
48
|
+
before(:each) { run_command('echo hello2') }
|
49
49
|
let(:command) { find_command('echo hello1') }
|
50
50
|
|
51
51
|
before(:each) { stop_all_commands }
|
@@ -67,9 +67,9 @@ Feature: Find a started command
|
|
67
67
|
|
68
68
|
RSpec.describe 'Run command', :type => :aruba do
|
69
69
|
before(:each) { set_environment_variable 'ENV_VAR', '1' }
|
70
|
-
before(:each) {
|
70
|
+
before(:each) { run_command('bash -c "echo -n $ENV_VAR"') }
|
71
71
|
before(:each) { set_environment_variable 'ENV_VAR', '2' }
|
72
|
-
before(:each) {
|
72
|
+
before(:each) { run_command('bash -c "echo -n $ENV_VAR"') }
|
73
73
|
|
74
74
|
let(:command) { find_command('bash -c "echo -n $ENV_VAR"') }
|
75
75
|
|
@@ -9,7 +9,7 @@ Feature: Return last command started
|
|
9
9
|
require 'spec_helper'
|
10
10
|
|
11
11
|
RSpec.describe 'Run command', :type => :aruba do
|
12
|
-
before(:each) {
|
12
|
+
before(:each) { run_command('echo hello') }
|
13
13
|
before(:each) { stop_all_commands }
|
14
14
|
|
15
15
|
it { expect(last_command_started).to be_successfully_executed }
|
@@ -25,8 +25,8 @@ Feature: Return last command started
|
|
25
25
|
require 'spec_helper'
|
26
26
|
|
27
27
|
RSpec.describe 'Run command', :type => :aruba do
|
28
|
-
before(:each) {
|
29
|
-
before(:each) {
|
28
|
+
before(:each) { run_command('echo hello') }
|
29
|
+
before(:each) { run_command('echo world') }
|
30
30
|
|
31
31
|
before(:each) { stop_all_commands }
|
32
32
|
|
@@ -9,7 +9,7 @@ Feature: Return last command stopped
|
|
9
9
|
require 'spec_helper'
|
10
10
|
|
11
11
|
RSpec.describe 'Run command', :type => :aruba do
|
12
|
-
before(:each) {
|
12
|
+
before(:each) { run_command('echo hello') }
|
13
13
|
before(:each) { stop_all_commands }
|
14
14
|
|
15
15
|
it { expect(last_command_stopped).to be_successfully_executed }
|
@@ -25,8 +25,8 @@ Feature: Return last command stopped
|
|
25
25
|
require 'spec_helper'
|
26
26
|
|
27
27
|
RSpec.describe 'Run command', :type => :aruba do
|
28
|
-
before(:each) {
|
29
|
-
before(:each) {
|
28
|
+
before(:each) { run_command('echo hello') }
|
29
|
+
before(:each) { run_command('echo world') }
|
30
30
|
|
31
31
|
before(:each) { stop_all_commands }
|
32
32
|
|
@@ -43,9 +43,9 @@ Feature: Return last command stopped
|
|
43
43
|
require 'spec_helper'
|
44
44
|
|
45
45
|
RSpec.describe 'Run command', :type => :aruba do
|
46
|
-
before(:each) {
|
46
|
+
before(:each) { run_command('echo hello') }
|
47
47
|
before(:each) { find_command('echo hello').stop }
|
48
|
-
before(:each) {
|
48
|
+
before(:each) { run_command('echo world') }
|
49
49
|
|
50
50
|
it { expect(last_command_stopped).to be_successfully_executed }
|
51
51
|
it { expect(last_command_stopped.commandline).to eq 'echo hello' }
|
@@ -80,7 +80,7 @@ Feature: Return last command stopped
|
|
80
80
|
require 'spec_helper'
|
81
81
|
|
82
82
|
RSpec.describe 'Run command', :type => :aruba do
|
83
|
-
before(:each) {
|
83
|
+
before(:each) { run_command('cli') }
|
84
84
|
|
85
85
|
it { expect{ last_command_stopped.commandline }.to raise_error Aruba::NoCommandHasBeenStoppedError }
|
86
86
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
Feature: Run command
|
2
2
|
|
3
|
-
To run a command use the `#
|
3
|
+
To run a command use the `#run_command`-method. There are some configuration options
|
4
4
|
which are relevant here:
|
5
5
|
|
6
6
|
- `startup_wait_time`:
|
7
7
|
|
8
8
|
Given this option `aruba` waits n seconds after it started the command.
|
9
|
-
This is most useful when using `#
|
10
|
-
`#
|
9
|
+
This is most useful when using `#run_command()` and not really makes sense for
|
10
|
+
`#run_command_and_stop()`.
|
11
11
|
|
12
|
-
You can use `#
|
12
|
+
You can use `#run_command()` + `startup_wait_time` to start background jobs.
|
13
13
|
|
14
14
|
- `exit_timeout`:
|
15
15
|
|
@@ -34,7 +34,7 @@ Feature: Run command
|
|
34
34
|
require 'spec_helper'
|
35
35
|
|
36
36
|
RSpec.describe 'Run command', :type => :aruba do
|
37
|
-
before(:each) {
|
37
|
+
before(:each) { run_command('cli') }
|
38
38
|
it { expect(last_command_started).to be_successfully_executed }
|
39
39
|
end
|
40
40
|
"""
|
@@ -52,7 +52,7 @@ Feature: Run command
|
|
52
52
|
require 'spec_helper'
|
53
53
|
|
54
54
|
RSpec.describe 'Run command', :type => :aruba do
|
55
|
-
before(:each) {
|
55
|
+
before(:each) { run_command('bin/cli') }
|
56
56
|
it { expect(last_command_started).to be_successfully_executed }
|
57
57
|
end
|
58
58
|
"""
|
@@ -66,7 +66,7 @@ Feature: Run command
|
|
66
66
|
require 'spec_helper'
|
67
67
|
|
68
68
|
RSpec.describe 'Find path for command', :type => :aruba do
|
69
|
-
it { expect {
|
69
|
+
it { expect { run_command('cli') }.to raise_error Aruba::LaunchError, /Command "cli" not found in PATH-variable/ }
|
70
70
|
end
|
71
71
|
"""
|
72
72
|
When I run `rspec`
|
@@ -112,7 +112,7 @@ Feature: Run command
|
|
112
112
|
require 'spec_helper'
|
113
113
|
|
114
114
|
RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 1, :startup_wait_time => 2 do
|
115
|
-
before(:each) {
|
115
|
+
before(:each) { run_command('cli') }
|
116
116
|
before(:each) { last_command_started.send_signal 'HUP' }
|
117
117
|
|
118
118
|
it { expect(last_command_started).to be_successfully_executed }
|
@@ -145,7 +145,7 @@ Feature: Run command
|
|
145
145
|
require 'spec_helper'
|
146
146
|
|
147
147
|
RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 3 do
|
148
|
-
before(:each) {
|
148
|
+
before(:each) { run_command('cli') }
|
149
149
|
|
150
150
|
it { expect(last_command_started).to be_successfully_executed }
|
151
151
|
it { expect(last_command_started).to have_output /Hello, Aruba here/ }
|
@@ -157,7 +157,7 @@ Feature: Run command
|
|
157
157
|
Scenario: Mixing commands with long and short startup phase (deprecated)
|
158
158
|
|
159
159
|
If you commands with a long and short startup phases, you should consider
|
160
|
-
using the `startup_wait_time`-option local to the `#
|
160
|
+
using the `startup_wait_time`-option local to the `#run_command`-call.
|
161
161
|
|
162
162
|
Given an executable named "bin/cli1" with:
|
163
163
|
"""bash
|
@@ -220,8 +220,8 @@ Feature: Run command
|
|
220
220
|
require 'spec_helper'
|
221
221
|
|
222
222
|
RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 1 do
|
223
|
-
before(:each) {
|
224
|
-
before(:each) {
|
223
|
+
before(:each) { run_command('cli1', 3, 0.1, 'TERM', 2) }
|
224
|
+
before(:each) { run_command('cli2', 3, 0.1, 'TERM', 1) }
|
225
225
|
before(:each) { last_command_started.send_signal 'HUP' }
|
226
226
|
|
227
227
|
it { expect(last_command_started).to be_successfully_executed }
|
@@ -236,7 +236,7 @@ Feature: Run command
|
|
236
236
|
Scenario: Mixing commands with long and short startup phase
|
237
237
|
|
238
238
|
If you commands with a long and short startup phases, you should consider
|
239
|
-
using the `startup_wait_time`-option local to the `#
|
239
|
+
using the `startup_wait_time`-option local to the `#run_command`-call.
|
240
240
|
|
241
241
|
Given an executable named "bin/cli1" with:
|
242
242
|
"""bash
|
@@ -299,8 +299,8 @@ Feature: Run command
|
|
299
299
|
require 'spec_helper'
|
300
300
|
|
301
301
|
RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 1 do
|
302
|
-
before(:each) {
|
303
|
-
before(:each) {
|
302
|
+
before(:each) { run_command('cli1', :startup_wait_time => 2) }
|
303
|
+
before(:each) { run_command('cli2', :startup_wait_time => 1) }
|
304
304
|
before(:each) { last_command_started.send_signal 'HUP' }
|
305
305
|
|
306
306
|
it { expect(last_command_started).to be_successfully_executed }
|
@@ -315,7 +315,7 @@ Feature: Run command
|
|
315
315
|
Scenario: Mixing long and short running commands (deprecated)
|
316
316
|
|
317
317
|
If need to mix "long running" and "short running" commands, you should consider using the
|
318
|
-
`exit_timeout`-option local to the `#
|
318
|
+
`exit_timeout`-option local to the `#run_command`-method.
|
319
319
|
|
320
320
|
Given an executable named "bin/cli1" with:
|
321
321
|
"""bash
|
@@ -343,8 +343,8 @@ Feature: Run command
|
|
343
343
|
require 'spec_helper'
|
344
344
|
|
345
345
|
RSpec.describe 'Run command', :type => :aruba do
|
346
|
-
before(:each) {
|
347
|
-
before(:each) {
|
346
|
+
before(:each) { run_command('cli1', 3) }
|
347
|
+
before(:each) { run_command('cli2', 1) }
|
348
348
|
|
349
349
|
it { expect(last_command_started).to be_successfully_executed }
|
350
350
|
it { expect(last_command_started).to have_output /Hello, Aruba here/ }
|
@@ -356,7 +356,7 @@ Feature: Run command
|
|
356
356
|
Scenario: Mixing long and short running commands
|
357
357
|
|
358
358
|
If need to mix "long running" and "short running" commands, you should consider using the
|
359
|
-
`exit_timeout`-option local to the `#
|
359
|
+
`exit_timeout`-option local to the `#run_command`-method.
|
360
360
|
|
361
361
|
Given an executable named "bin/cli1" with:
|
362
362
|
"""bash
|
@@ -384,8 +384,8 @@ Feature: Run command
|
|
384
384
|
require 'spec_helper'
|
385
385
|
|
386
386
|
RSpec.describe 'Run command', :type => :aruba do
|
387
|
-
before(:each) {
|
388
|
-
before(:each) {
|
387
|
+
before(:each) { run_command('cli1', :exit_timeout => 3) }
|
388
|
+
before(:each) { run_command('cli2', :exit_timeout => 1) }
|
389
389
|
|
390
390
|
it { expect(last_command_started).to be_successfully_executed }
|
391
391
|
it { expect(last_command_started).to have_output /Hello, Aruba here/ }
|
@@ -405,7 +405,7 @@ Feature: Run command
|
|
405
405
|
require 'spec_helper'
|
406
406
|
|
407
407
|
RSpec.describe 'Run command', :type => :aruba do
|
408
|
-
before(:each) {
|
408
|
+
before(:each) { run_command('cli') }
|
409
409
|
let!(:found_command) { find_command('cli') }
|
410
410
|
it { expect { found_command.start }.to raise_error Aruba::CommandAlreadyStartedError }
|
411
411
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Feature: Run command
|
2
2
|
|
3
|
-
To run a command use the `#
|
3
|
+
To run a command use the `#run_command_and_stop`-method. There are some configuration options
|
4
4
|
which are relevant here:
|
5
5
|
|
6
6
|
- `fail_on_error`:
|
@@ -23,7 +23,7 @@ Feature: Run command
|
|
23
23
|
require 'spec_helper'
|
24
24
|
|
25
25
|
RSpec.describe 'Run command', :type => :aruba do
|
26
|
-
it { expect {
|
26
|
+
it { expect { run_command_and_stop('cli') }.to raise_error RSpec::Expectations::ExpectationNotMetError }
|
27
27
|
end
|
28
28
|
"""
|
29
29
|
When I run `rspec`
|
@@ -40,7 +40,7 @@ Feature: Run command
|
|
40
40
|
require 'spec_helper'
|
41
41
|
|
42
42
|
RSpec.describe 'Run command', :type => :aruba do
|
43
|
-
it { expect {
|
43
|
+
it { expect { run_command_and_stop('cli', :fail_on_error => true) }.to raise_error }
|
44
44
|
end
|
45
45
|
"""
|
46
46
|
When I run `rspec`
|
@@ -57,7 +57,7 @@ Feature: Run command
|
|
57
57
|
require 'spec_helper'
|
58
58
|
|
59
59
|
RSpec.describe 'Run command', :type => :aruba do
|
60
|
-
it { expect {
|
60
|
+
it { expect { run_command_and_stop('cli', true) }.to raise_error }
|
61
61
|
end
|
62
62
|
"""
|
63
63
|
When I run `rspec`
|
@@ -74,7 +74,7 @@ Feature: Run command
|
|
74
74
|
require 'spec_helper'
|
75
75
|
|
76
76
|
RSpec.describe 'Run command', :type => :aruba do
|
77
|
-
it { expect {
|
77
|
+
it { expect { run_command_and_stop('cli', :fail_on_error => false) }.not_to raise_error }
|
78
78
|
end
|
79
79
|
"""
|
80
80
|
When I run `rspec`
|
@@ -91,7 +91,7 @@ Feature: Run command
|
|
91
91
|
require 'spec_helper'
|
92
92
|
|
93
93
|
RSpec.describe 'Run command', :type => :aruba do
|
94
|
-
it { expect {
|
94
|
+
it { expect { run_command_and_stop('cli', false) }.not_to raise_error }
|
95
95
|
end
|
96
96
|
"""
|
97
97
|
When I run `rspec`
|
@@ -126,7 +126,7 @@ Feature: Run command
|
|
126
126
|
require 'spec_helper'
|
127
127
|
|
128
128
|
RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 1, :startup_wait_time => 2 do
|
129
|
-
before(:each) {
|
129
|
+
before(:each) { run_command_and_stop('cli') }
|
130
130
|
|
131
131
|
it { expect(last_command_started).to be_successfully_executed }
|
132
132
|
it { expect(last_command_started).to have_output /Hello, Aruba is working/ }
|
@@ -156,7 +156,7 @@ Feature: Run command
|
|
156
156
|
require 'spec_helper'
|
157
157
|
|
158
158
|
RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 3 do
|
159
|
-
before(:each) {
|
159
|
+
before(:each) { run_command_and_stop('cli') }
|
160
160
|
|
161
161
|
it { expect(last_command_started).to be_successfully_executed }
|
162
162
|
it { expect(last_command_started).to have_output /Hello, Aruba here/ }
|
@@ -165,10 +165,10 @@ Feature: Run command
|
|
165
165
|
When I run `rspec`
|
166
166
|
Then the specs should all pass
|
167
167
|
|
168
|
-
Scenario: Sending signals to commands started with `#
|
168
|
+
Scenario: Sending signals to commands started with `#run_command_and_stop()`
|
169
169
|
|
170
170
|
Sending signals to a command which is started by
|
171
|
-
`#
|
171
|
+
`#run_command_and_stop()` does not make sense. The command is stopped internally when
|
172
172
|
its exit status is checked.
|
173
173
|
|
174
174
|
Given an executable named "bin/cli" with:
|
@@ -199,7 +199,7 @@ Feature: Run command
|
|
199
199
|
require 'spec_helper'
|
200
200
|
|
201
201
|
RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 2, :startup_wait_time => 1 do
|
202
|
-
before(:each) {
|
202
|
+
before(:each) { run_command_and_stop('cli') }
|
203
203
|
it { expect { last_command_started.send_signal 'HUP' }.to raise_error Aruba::CommandAlreadyStoppedError }
|
204
204
|
end
|
205
205
|
"""
|
@@ -224,7 +224,7 @@ Feature: Run command
|
|
224
224
|
end
|
225
225
|
|
226
226
|
RSpec.describe 'Run command', :type => :aruba do
|
227
|
-
it { expect {
|
227
|
+
it { expect { run_command_and_stop('cli', :fail_on_error => true) }.to_not raise_error }
|
228
228
|
end
|
229
229
|
"""
|
230
230
|
When I run `rspec`
|
@@ -26,7 +26,7 @@ Feature: Send running command a signal
|
|
26
26
|
require 'spec_helper'
|
27
27
|
|
28
28
|
RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 1, :startup_wait_time => 5 do
|
29
|
-
before(:each) {
|
29
|
+
before(:each) { run_command('cli') }
|
30
30
|
before(:each) { last_command_started.send_signal 'HUP' }
|
31
31
|
it { expect(last_command_started).to have_output /Exit/ }
|
32
32
|
end
|
@@ -45,7 +45,7 @@ Feature: Send running command a signal
|
|
45
45
|
require 'spec_helper'
|
46
46
|
|
47
47
|
RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 1, :startup_wait_time => 5 do
|
48
|
-
before(:each) {
|
48
|
+
before(:each) { run_command('cli') }
|
49
49
|
it { expect { last_command_started.send_signal 'HUP' }.to raise_error Aruba::CommandAlreadyStoppedError, /Command "cli" with PID/ }
|
50
50
|
end
|
51
51
|
"""
|
@@ -18,7 +18,7 @@ Feature: Access STDERR of command
|
|
18
18
|
require 'spec_helper'
|
19
19
|
|
20
20
|
RSpec.describe 'Run command', :type => :aruba do
|
21
|
-
before(:each) {
|
21
|
+
before(:each) { run_command('cli') }
|
22
22
|
before(:each) { stop_all_commands }
|
23
23
|
it { expect(last_command_started.stderr).to start_with 'Hello' }
|
24
24
|
end
|
@@ -38,7 +38,7 @@ Feature: Access STDERR of command
|
|
38
38
|
require 'spec_helper'
|
39
39
|
|
40
40
|
RSpec.describe 'Run command', :type => :aruba, :io_wait_timeout => 2 do
|
41
|
-
before(:each) {
|
41
|
+
before(:each) { run_command('cli') }
|
42
42
|
it { expect(last_command_started.stderr).to start_with 'Hello' }
|
43
43
|
end
|
44
44
|
"""
|