aruba 0.11.1 → 0.11.2
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/.travis.yml +22 -14
- data/History.md +11 -7
- data/README.md +121 -27
- data/features/api/command/find_command.feature +2 -2
- data/features/api/command/run_simple.feature +207 -0
- data/lib/aruba/api/command.rb +18 -16
- data/lib/aruba/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 640c6d6d67827e65e671ee40fea3fd3bd8b40138
|
4
|
+
data.tar.gz: a726ab79cf1c258322423cccbcb8ab325a5af0d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c061409af3d9b559ba62ad74c7dba3af505dfd87224b246a0ec4d7f11a1d82631e827ae0755eb93bbec0e0c6c12099ff634d3a90938edabf1029f4a0a572ec4
|
7
|
+
data.tar.gz: e05cb84b2085d874698c2aaf34b6d91f94005d421e5d22cefddfd3b65b9ee366d8ffde4f8315f0fa7232db7d89fba51d31923954776a5ef37ccee0d3afcf9163
|
data/.travis.yml
CHANGED
@@ -3,25 +3,32 @@ language: ruby
|
|
3
3
|
script: script/test
|
4
4
|
install: script/bootstrap --without development debug
|
5
5
|
rvm:
|
6
|
-
- 1.8.7
|
7
|
-
- 1.9.2
|
8
|
-
- 1.9.3
|
9
|
-
- 2.0.0
|
10
|
-
- 2.1.7
|
11
|
-
- 2.2.3
|
12
|
-
- jruby
|
13
|
-
- jruby-20mode
|
14
|
-
- jruby-21mode
|
15
|
-
-
|
16
|
-
- jruby-9.0.0.0-20mode
|
17
|
-
- jruby-9.0.0.0-21mode
|
18
|
-
- rbx
|
6
|
+
- 1.8.7
|
7
|
+
- 1.9.2
|
8
|
+
- 1.9.3
|
9
|
+
- 2.0.0
|
10
|
+
- 2.1.7
|
11
|
+
- 2.2.3
|
12
|
+
- jruby
|
13
|
+
- jruby-20mode
|
14
|
+
- jruby-21mode
|
15
|
+
- rbx
|
19
16
|
matrix:
|
17
|
+
include:
|
18
|
+
- rvm: jruby-9.0.0.0
|
19
|
+
env: JRUBY_OPTS='--dev'
|
20
|
+
- rvm: jruby-9.0.0.0-20mode
|
21
|
+
env: JRUBY_OPTS='--dev'
|
22
|
+
- rvm: jruby-9.0.0.0-21mode
|
23
|
+
env: JRUBY_OPTS='--dev'
|
20
24
|
allow_failures:
|
21
25
|
- rvm: rbx
|
22
26
|
- rvm: jruby-9.0.0.0
|
27
|
+
env: JRUBY_OPTS='--dev'
|
23
28
|
- rvm: jruby-9.0.0.0-20mode
|
29
|
+
env: JRUBY_OPTS='--dev'
|
24
30
|
- rvm: jruby-9.0.0.0-21mode
|
31
|
+
env: JRUBY_OPTS='--dev'
|
25
32
|
notifications:
|
26
33
|
email:
|
27
34
|
- cukes-devs@googlegroups.com
|
@@ -31,4 +38,5 @@ notifications:
|
|
31
38
|
env:
|
32
39
|
global:
|
33
40
|
- secure: l8uznA5K4K9mZ1krmP3lTMD8WcJ32qGxFOR3jubKHcOBSLB4xSzU2aIqjyJdO+rLzebkwamhJc8pGSIWOUDQYvFiX7splK+uEkbBJ5huAhXtLF4Qgl86bCWbEXYzN7rvn0DQfpJAovyFMNRMnfo70XhwqWzFsaYa7Z0YbqYsJE4=
|
34
|
-
- JRUBY_OPTS='
|
41
|
+
# - JRUBY_OPTS='-Xcli.debug=true --debug'
|
42
|
+
- JRUBY_OPTS='--dev'
|
data/History.md
CHANGED
@@ -1,26 +1,30 @@
|
|
1
1
|
# Latest Release
|
2
2
|
|
3
|
-
## [v0.11.
|
3
|
+
## [v0.11.2](https://github.com/cucumber/aruba/compare/v0.11.1...v0.11.2)
|
4
4
|
|
5
|
-
*
|
6
|
-
* Refactored and improved documentation (feature tests) in PR #309
|
5
|
+
* Fixed problem with positional arguments in `#run_simple()` (issue #322)
|
7
6
|
|
8
7
|
# Old releases
|
9
8
|
|
10
|
-
## [v0.11.
|
9
|
+
## [v0.11.1](https://github.com/cucumber/aruba/compare/v0.11.0...v0.11.1)
|
10
|
+
|
11
|
+
* Use fixed version of event-bus
|
12
|
+
* Refactored and improved documentation (feature tests) in PR #309
|
13
|
+
|
14
|
+
## [v0.11.0](https://github.com/cucumber/aruba/compare/v0.11.0.pre4...v0.11.0)
|
11
15
|
|
12
16
|
* Accidently pushed to rubygems.org - yanked it afterwards
|
13
17
|
|
14
|
-
## [v0.11.0.pre4](https://github.com/cucumber/aruba/compare/v0.11.pre3...v0.11.0.pre4)
|
18
|
+
## [v0.11.0.pre4](https://github.com/cucumber/aruba/compare/v0.11.0.pre3...v0.11.0.pre4)
|
15
19
|
|
16
20
|
* Fixed syntax for Hash on ruby 1.8.7
|
17
21
|
* Reorder rubies in .travis.yml
|
18
22
|
|
19
|
-
## [v0.11.0.pre3](https://github.com/cucumber/aruba/compare/v0.11.pre2...v0.11.0.pre3)
|
23
|
+
## [v0.11.0.pre3](https://github.com/cucumber/aruba/compare/v0.11.0.pre2...v0.11.0.pre3)
|
20
24
|
|
21
25
|
* Fixed syntax for proc on ruby 1.8.7
|
22
26
|
|
23
|
-
## [v0.11.0.pre2](https://github.com/cucumber/aruba/compare/v0.11.pre...v0.11.0.pre2)
|
27
|
+
## [v0.11.0.pre2](https://github.com/cucumber/aruba/compare/v0.11.0.pre...v0.11.0.pre2)
|
24
28
|
|
25
29
|
* Integrate `EventBus` to decouple announcers from starting, stopping commands
|
26
30
|
etc. This uses nearly the same implementation like `cucumber`. (PR #309)
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Build status:
|
|
7
7
|
|
8
8
|
Linux / OS X | Windows
|
9
9
|
------------- | -------------
|
10
|
-
[](
|
10
|
+
[](https://travis-ci.org/cucumber/aruba) | [](https://ci.appveyor.com/project/cucumberbdd/aruba/branch/master)
|
11
11
|
|
12
12
|
`aruba` is an extension for popular TDD and BDD frameworks like "Cucumber", "RSpec" and "Minitest" to make testing of commandline applications meaningful, easy and fun.
|
13
13
|
|
@@ -43,48 +43,142 @@ For an up to date list of all supported ruby versions, please see our [`.travis.
|
|
43
43
|
|
44
44
|
## Usage
|
45
45
|
|
46
|
+
Please also see this
|
47
|
+
[feature test](https://github.com/cucumber/aruba/blob/master/features/getting_started/supported_testing_frameworks.feature)
|
48
|
+
for the most up to date documentation.
|
49
|
+
|
50
|
+
### Initialize your project with "aruba"
|
51
|
+
|
52
|
+
There's an initializer to make it easier for you to getting started. If you
|
53
|
+
prefer to setup `aruba` yourself, please move on to the next section.
|
54
|
+
|
55
|
+
1. Go to your project's directory
|
56
|
+
|
57
|
+
2. Make sure, it's under version control and all changes are committed to your
|
58
|
+
version control repository
|
59
|
+
|
60
|
+
3. Run one of the following commands depending on the tools you use to test your project.
|
61
|
+
|
62
|
+
This assumes, that you use either `rspec`, `cucumber-ruby` or `minitest` to
|
63
|
+
write the tests for your project. Besides that, your tool can be implemented
|
64
|
+
in any programming language you like.
|
65
|
+
|
66
|
+
~~~bash
|
67
|
+
aruba init --test-framework rspec
|
68
|
+
aruba init --test-framework cucumber
|
69
|
+
aruba init --test-framework minitest
|
70
|
+
~~~
|
71
|
+
|
46
72
|
### Cucumber
|
47
73
|
|
48
|
-
|
49
|
-
|
74
|
+
1. Create a file named "features/support/env.rb" with:
|
75
|
+
|
76
|
+
~~~ruby
|
77
|
+
require 'aruba/cucumber'
|
78
|
+
~~~
|
50
79
|
|
51
|
-
|
52
|
-
require 'aruba/cucumber'
|
53
|
-
```
|
80
|
+
2. Create a file named "features/use_aruba_with_cucumber.feature" with:
|
54
81
|
|
55
|
-
|
56
|
-
|
57
|
-
|
82
|
+
~~~ruby
|
83
|
+
Feature: Cucumber
|
84
|
+
Scenario: First Run
|
85
|
+
Given a file named "file.txt" with:
|
86
|
+
"""
|
87
|
+
Hello World
|
88
|
+
"""
|
89
|
+
Then the file "file.txt" should contain:
|
90
|
+
"""
|
91
|
+
Hello World
|
92
|
+
"""
|
93
|
+
~~~
|
94
|
+
|
95
|
+
3. Run `cucumber`
|
58
96
|
|
59
97
|
### RSpec
|
60
98
|
|
61
|
-
|
62
|
-
|
99
|
+
1. Create a file named "spec/support/aruba.rb" with:
|
100
|
+
|
101
|
+
~~~ruby
|
102
|
+
require 'aruba/rspec'
|
103
|
+
~~~
|
104
|
+
|
105
|
+
2. Create a file named "spec/spec_helper.rb" with:
|
106
|
+
|
107
|
+
~~~ruby
|
108
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
109
|
+
|
110
|
+
if RUBY_VERSION < '1.9.3'
|
111
|
+
::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require File.join(File.dirname(f), File.basename(f, '.rb')) }
|
112
|
+
else
|
113
|
+
::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f }
|
114
|
+
end
|
115
|
+
~~~
|
63
116
|
|
64
|
-
|
65
|
-
2. Create a file named `spec/support/aruba.rb` with:
|
117
|
+
3. Create a file named named "spec/use_aruba_with_rspec_spec.rb" with:
|
66
118
|
|
67
|
-
|
68
|
-
|
69
|
-
```
|
119
|
+
~~~ruby
|
120
|
+
require 'spec_helper'
|
70
121
|
|
71
|
-
|
122
|
+
RSpec.describe 'First Run', :type => :aruba do
|
123
|
+
let(:file) { 'file.txt' }
|
124
|
+
let(:content) { 'Hello World' }
|
72
125
|
|
73
|
-
|
74
|
-
Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require_relative f }
|
75
|
-
```
|
126
|
+
before(:each) { write_file file, content }
|
76
127
|
|
77
|
-
|
128
|
+
it { expect(read(file)).to eq [content] }
|
129
|
+
end
|
130
|
+
~~~
|
78
131
|
|
79
|
-
|
80
|
-
RSpec.describe 'My feature', type: :aruba do
|
81
|
-
# [...]
|
82
|
-
end
|
83
|
-
```
|
132
|
+
4. Run `rspec`
|
84
133
|
|
85
134
|
### Minitest
|
86
135
|
|
87
|
-
|
136
|
+
1. Add a file named "test/support/aruba.rb" with:
|
137
|
+
|
138
|
+
~~~ ruby
|
139
|
+
require 'aruba/api'
|
140
|
+
~~~
|
141
|
+
|
142
|
+
2. Add a file named "test/test_helper.rb" with:
|
143
|
+
|
144
|
+
~~~ruby
|
145
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
146
|
+
|
147
|
+
if RUBY_VERSION < '1.9.3'
|
148
|
+
::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require File.join(File.dirname(f), File.basename(f, '.rb')) }
|
149
|
+
else
|
150
|
+
::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f }
|
151
|
+
end
|
152
|
+
~~~
|
153
|
+
|
154
|
+
3. Add a file named "test/use_aruba_with_minitest.rb" with:
|
155
|
+
|
156
|
+
~~~ruby
|
157
|
+
$LOAD_PATH.unshift File.expand_path('../test', __FILE__)
|
158
|
+
|
159
|
+
require 'test_helper'
|
160
|
+
require 'minitest/autorun'
|
161
|
+
|
162
|
+
class FirstRun < Minitest::Test
|
163
|
+
include Aruba::Api
|
164
|
+
|
165
|
+
def setup
|
166
|
+
aruba_setup
|
167
|
+
end
|
168
|
+
|
169
|
+
def getting_started_with_aruba
|
170
|
+
file = 'file.txt'
|
171
|
+
content = 'Hello World'
|
172
|
+
|
173
|
+
write_file file, content
|
174
|
+
read(file).must_equal [content]
|
175
|
+
end
|
176
|
+
end
|
177
|
+
~~~
|
178
|
+
|
179
|
+
4. Run your tests
|
180
|
+
|
181
|
+
`ruby -Ilib:test test/use_aruba_with_minitest.rb`
|
88
182
|
|
89
183
|
## Documentation
|
90
184
|
|
@@ -5,7 +5,7 @@ Feature: Find a started command
|
|
5
5
|
Background:
|
6
6
|
Given I use a fixture named "cli-app"
|
7
7
|
|
8
|
-
Scenario:
|
8
|
+
Scenario: Existing command
|
9
9
|
Given a file named "spec/run_spec.rb" with:
|
10
10
|
"""ruby
|
11
11
|
require 'spec_helper'
|
@@ -23,7 +23,7 @@ Feature: Find a started command
|
|
23
23
|
When I run `rspec`
|
24
24
|
Then the specs should all pass
|
25
25
|
|
26
|
-
Scenario: Non-
|
26
|
+
Scenario: Non-Existing command
|
27
27
|
Given a file named "spec/run_spec.rb" with:
|
28
28
|
"""ruby
|
29
29
|
require 'spec_helper'
|
@@ -0,0 +1,207 @@
|
|
1
|
+
Feature: Run command
|
2
|
+
|
3
|
+
To run a command use the `#run`-method. There are some configuration options
|
4
|
+
which are relevant here:
|
5
|
+
|
6
|
+
- `fail_on_error`:
|
7
|
+
|
8
|
+
Given this option is `true`, `aruba` fails if the `command` fails to run - exit code <> 0.
|
9
|
+
|
10
|
+
For all other options see [run.feature](run.feature).
|
11
|
+
|
12
|
+
Background:
|
13
|
+
Given I use a fixture named "cli-app"
|
14
|
+
|
15
|
+
Scenario: Require executable to succeed (by default value)
|
16
|
+
Given an executable named "bin/cli" with:
|
17
|
+
"""bash
|
18
|
+
#!/bin/bash
|
19
|
+
exit 1
|
20
|
+
"""
|
21
|
+
And a file named "spec/run_spec.rb" with:
|
22
|
+
"""ruby
|
23
|
+
require 'spec_helper'
|
24
|
+
|
25
|
+
RSpec.describe 'Run command', :type => :aruba do
|
26
|
+
it { expect { run_simple('cli') }.to raise_error RSpec::Expectations::ExpectationNotMetError }
|
27
|
+
end
|
28
|
+
"""
|
29
|
+
When I run `rspec`
|
30
|
+
Then the specs should all pass
|
31
|
+
|
32
|
+
Scenario: Require executable to succeed (set by option)
|
33
|
+
Given an executable named "bin/cli" with:
|
34
|
+
"""bash
|
35
|
+
#!/bin/bash
|
36
|
+
exit 1
|
37
|
+
"""
|
38
|
+
And a file named "spec/run_spec.rb" with:
|
39
|
+
"""ruby
|
40
|
+
require 'spec_helper'
|
41
|
+
|
42
|
+
RSpec.describe 'Run command', :type => :aruba do
|
43
|
+
it { expect { run_simple('cli', :fail_on_error => true) }.to raise_error }
|
44
|
+
end
|
45
|
+
"""
|
46
|
+
When I run `rspec`
|
47
|
+
Then the specs should all pass
|
48
|
+
|
49
|
+
Scenario: Require executable to succeed (set by option, deprecated)
|
50
|
+
Given an executable named "bin/cli" with:
|
51
|
+
"""bash
|
52
|
+
#!/bin/bash
|
53
|
+
exit 1
|
54
|
+
"""
|
55
|
+
And a file named "spec/run_spec.rb" with:
|
56
|
+
"""ruby
|
57
|
+
require 'spec_helper'
|
58
|
+
|
59
|
+
RSpec.describe 'Run command', :type => :aruba do
|
60
|
+
it { expect { run_simple('cli', true) }.to raise_error }
|
61
|
+
end
|
62
|
+
"""
|
63
|
+
When I run `rspec`
|
64
|
+
Then the specs should all pass
|
65
|
+
|
66
|
+
Scenario: Ignore failure of executable (set by option)
|
67
|
+
Given an executable named "bin/cli" with:
|
68
|
+
"""bash
|
69
|
+
#!/bin/bash
|
70
|
+
exit 1
|
71
|
+
"""
|
72
|
+
And a file named "spec/run_spec.rb" with:
|
73
|
+
"""ruby
|
74
|
+
require 'spec_helper'
|
75
|
+
|
76
|
+
RSpec.describe 'Run command', :type => :aruba do
|
77
|
+
it { expect { run_simple('cli', :fail_on_error => false) }.not_to raise_error }
|
78
|
+
end
|
79
|
+
"""
|
80
|
+
When I run `rspec`
|
81
|
+
Then the specs should all pass
|
82
|
+
|
83
|
+
Scenario: Ignore failure of executable (set by option, deprecated)
|
84
|
+
Given an executable named "bin/cli" with:
|
85
|
+
"""bash
|
86
|
+
#!/bin/bash
|
87
|
+
exit 1
|
88
|
+
"""
|
89
|
+
And a file named "spec/run_spec.rb" with:
|
90
|
+
"""ruby
|
91
|
+
require 'spec_helper'
|
92
|
+
|
93
|
+
RSpec.describe 'Run command', :type => :aruba do
|
94
|
+
it { expect { run_simple('cli', false) }.not_to raise_error }
|
95
|
+
end
|
96
|
+
"""
|
97
|
+
When I run `rspec`
|
98
|
+
Then the specs should all pass
|
99
|
+
|
100
|
+
Scenario: Command with long startup phase
|
101
|
+
|
102
|
+
If you have got a command with a long startup phase or use `ruby` together
|
103
|
+
with `bundler`, you should consider using the `startup_wait_time`-option.
|
104
|
+
Otherwise methods like `#send_signal` don't work since they require the
|
105
|
+
command to be running and have setup it's signal handler.
|
106
|
+
|
107
|
+
Given an executable named "bin/cli" with:
|
108
|
+
"""bash
|
109
|
+
#!/usr/bin/env bash
|
110
|
+
|
111
|
+
function initialize_script {
|
112
|
+
sleep 2
|
113
|
+
}
|
114
|
+
|
115
|
+
function do_some_work {
|
116
|
+
echo "Hello, Aruba is working"
|
117
|
+
}
|
118
|
+
|
119
|
+
initialize_script
|
120
|
+
do_some_work
|
121
|
+
|
122
|
+
exit 0
|
123
|
+
"""
|
124
|
+
And a file named "spec/run_spec.rb" with:
|
125
|
+
"""ruby
|
126
|
+
require 'spec_helper'
|
127
|
+
|
128
|
+
RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 1, :startup_wait_time => 2 do
|
129
|
+
before(:each) { run_simple('cli') }
|
130
|
+
|
131
|
+
it { expect(last_command_started).to be_successfully_executed }
|
132
|
+
it { expect(last_command_started).to have_output /Hello, Aruba is working/ }
|
133
|
+
end
|
134
|
+
"""
|
135
|
+
When I run `rspec`
|
136
|
+
Then the specs should all pass
|
137
|
+
|
138
|
+
Scenario: Long running command
|
139
|
+
|
140
|
+
If you have got a "long running" command, you should consider using the
|
141
|
+
`exit_timeout`-option.
|
142
|
+
|
143
|
+
Given an executable named "bin/cli" with:
|
144
|
+
"""bash
|
145
|
+
#!/usr/bin/env bash
|
146
|
+
|
147
|
+
function do_some_work {
|
148
|
+
sleep 2
|
149
|
+
echo "Hello, Aruba here"
|
150
|
+
}
|
151
|
+
|
152
|
+
do_some_work
|
153
|
+
"""
|
154
|
+
And a file named "spec/run_spec.rb" with:
|
155
|
+
"""ruby
|
156
|
+
require 'spec_helper'
|
157
|
+
|
158
|
+
RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 3 do
|
159
|
+
before(:each) { run_simple('cli') }
|
160
|
+
|
161
|
+
it { expect(last_command_started).to be_successfully_executed }
|
162
|
+
it { expect(last_command_started).to have_output /Hello, Aruba here/ }
|
163
|
+
end
|
164
|
+
"""
|
165
|
+
When I run `rspec`
|
166
|
+
Then the specs should all pass
|
167
|
+
|
168
|
+
Scenario: Sending signals to commands started with `#run_simple()`
|
169
|
+
|
170
|
+
Sending signals to a command which is started by
|
171
|
+
`#run_simple()` does not make sense. The command is stopped internally when
|
172
|
+
its exit status is checked.
|
173
|
+
|
174
|
+
Given an executable named "bin/cli" with:
|
175
|
+
"""bash
|
176
|
+
#!/usr/bin/env bash
|
177
|
+
|
178
|
+
function initialize_script {
|
179
|
+
sleep 1
|
180
|
+
}
|
181
|
+
|
182
|
+
function cleanup_script {
|
183
|
+
sleep 1
|
184
|
+
}
|
185
|
+
|
186
|
+
function do_some_work {
|
187
|
+
echo "Hello, Aruba is working"
|
188
|
+
}
|
189
|
+
|
190
|
+
trap stop_script TERM
|
191
|
+
|
192
|
+
initialize_script
|
193
|
+
do_some_work
|
194
|
+
cleanup_script
|
195
|
+
exit 0
|
196
|
+
"""
|
197
|
+
And a file named "spec/run_spec.rb" with:
|
198
|
+
"""ruby
|
199
|
+
require 'spec_helper'
|
200
|
+
|
201
|
+
RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 2, :startup_wait_time => 1 do
|
202
|
+
before(:each) { run_simple('cli') }
|
203
|
+
it { expect { last_command_started.send_signal 'HUP' }.to raise_error Aruba::CommandAlreadyStoppedError }
|
204
|
+
end
|
205
|
+
"""
|
206
|
+
When I run `rspec`
|
207
|
+
Then the specs should all pass
|
data/lib/aruba/api/command.rb
CHANGED
@@ -144,19 +144,19 @@ module Aruba
|
|
144
144
|
if args.last.is_a? Hash
|
145
145
|
opts = args.pop
|
146
146
|
|
147
|
-
exit_timeout = opts
|
148
|
-
io_wait_timeout = opts
|
149
|
-
stop_signal = opts
|
150
|
-
startup_wait_time = opts
|
147
|
+
exit_timeout = opts[:exit_timeout].nil? ? aruba.config.exit_timeout : opts[:exit_timeout]
|
148
|
+
io_wait_timeout = opts[:io_wait_timeout].nil? ? aruba.config.io_wait_timeout : opts[:io_wait_timeout]
|
149
|
+
stop_signal = opts[:stop_signal].nil? ? aruba.config.stop_signal : opts[:stop_signal]
|
150
|
+
startup_wait_time = opts[:startup_wait_time].nil? ? aruba.config.startup_wait_time : opts[:startup_wait_time]
|
151
151
|
else
|
152
152
|
if args.size > 1
|
153
153
|
Aruba.platform.deprecated("Please pass options to `#run` as named parameters/hash and don\'t use the old style, e.g. `#run('cmd', :exit_timeout => 5)`.")
|
154
154
|
end
|
155
155
|
|
156
|
-
exit_timeout = args[0]
|
157
|
-
io_wait_timeout = args[1]
|
158
|
-
stop_signal = args[2]
|
159
|
-
startup_wait_time = args[3]
|
156
|
+
exit_timeout = args[0].nil? ? aruba.config.exit_timeout : args[0]
|
157
|
+
io_wait_timeout = args[1].nil? ? aruba.config.io_wait_timeout : args[1]
|
158
|
+
stop_signal = args[2].nil? ? aruba.config.stop_signal : args[2]
|
159
|
+
startup_wait_time = args[3].nil? ? aruba.config.startup_wait_time : args[3]
|
160
160
|
end
|
161
161
|
|
162
162
|
cmd = replace_variables(cmd)
|
@@ -257,10 +257,7 @@ module Aruba
|
|
257
257
|
|
258
258
|
if args.last.is_a? Hash
|
259
259
|
opts = args.pop
|
260
|
-
|
261
|
-
fail_on_error = opts.fetch(:fail_on_error, false) || false
|
262
|
-
exit_timeout = opts.fetch(:exit_timeout, aruba.config.exit_timeout) || aruba.config.exit_timeout
|
263
|
-
io_wait_timeout = opts.fetch(:io_wait_timeout, aruba.config.io_wait_timeout) || aruba.config.io_wait_timeout
|
260
|
+
fail_on_error = opts.delete(:fail_on_error) == true ? true : false
|
264
261
|
else
|
265
262
|
if args.size > 1
|
266
263
|
# rubocop:disable Metrics/LineLength
|
@@ -268,12 +265,17 @@ module Aruba
|
|
268
265
|
# rubocop:enable Metrics/LineLength
|
269
266
|
end
|
270
267
|
|
271
|
-
fail_on_error
|
272
|
-
|
273
|
-
|
268
|
+
fail_on_error = args[0] == false ? false : true
|
269
|
+
|
270
|
+
opts = {
|
271
|
+
:exit_timeout => (args[1] || aruba.config.exit_timeout),
|
272
|
+
:io_wait_timeout => (args[2] || aruba.config.io_wait_timeout),
|
273
|
+
:stop_signal => (args[3] || aruba.config.stop_signal),
|
274
|
+
:startup_wait_time => (args[4] || aruba.config.startup_wait_time)
|
275
|
+
}
|
274
276
|
end
|
275
277
|
|
276
|
-
command = run(cmd,
|
278
|
+
command = run(cmd, opts)
|
277
279
|
command.stop
|
278
280
|
|
279
281
|
if Aruba::VERSION < '1'
|
data/lib/aruba/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aruba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aslak Hellesøy
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2015-
|
16
|
+
date: 2015-12-09 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: cucumber
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- features/api/command/last_command_started.feature
|
161
161
|
- features/api/command/last_command_stopped.feature
|
162
162
|
- features/api/command/run.feature
|
163
|
+
- features/api/command/run_simple.feature
|
163
164
|
- features/api/command/send_signal.feature
|
164
165
|
- features/api/command/stop.feature
|
165
166
|
- features/api/command/stop_all_commands.feature
|
@@ -471,12 +472,13 @@ rubyforge_project:
|
|
471
472
|
rubygems_version: 2.4.5.1
|
472
473
|
signing_key:
|
473
474
|
specification_version: 4
|
474
|
-
summary: aruba-0.11.
|
475
|
+
summary: aruba-0.11.2
|
475
476
|
test_files:
|
476
477
|
- features/api/command/find_command.feature
|
477
478
|
- features/api/command/last_command_started.feature
|
478
479
|
- features/api/command/last_command_stopped.feature
|
479
480
|
- features/api/command/run.feature
|
481
|
+
- features/api/command/run_simple.feature
|
480
482
|
- features/api/command/send_signal.feature
|
481
483
|
- features/api/command/stop.feature
|
482
484
|
- features/api/command/stop_all_commands.feature
|