aruba 0.14.10 → 0.14.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/Gemfile +3 -1
- data/aruba.gemspec +1 -1
- data/lib/aruba/api/deprecated.rb +5 -13
- data/lib/aruba/cucumber/command.rb +3 -3
- data/lib/aruba/platforms/command_monitor.rb +1 -1
- data/lib/aruba/processes/spawn_process.rb +4 -2
- data/lib/aruba/version.rb +1 -1
- data/spec/aruba/api/commands_spec.rb +30 -0
- data/spec/aruba/api/core_spec.rb +84 -42
- data/spec/aruba/api_spec.rb +0 -24
- metadata +6 -6
- data/features/support/jruby.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 060046e288870eabc33857b26f77aab613780b56e2708fa792a05d6c92b5d889
|
4
|
+
data.tar.gz: ad6ec98600b5caeaa4a086e7dd87d9c38bb5949aca1a03bd4e35b263899527be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f64c63be6aa7ac7944221ab21b6c90252c920dcda7f14e4879002e72aabb2d197f44519fccb1cce5f23bd0450199f1f065140aeda6fb3781c95fcd7eb27210d6
|
7
|
+
data.tar.gz: 3b64947ad59c0b3d13ec081493325900c080d1e3cbd107d957e9c58ecfc052065afef3aedc7bd46d824586ba3fa4af6c3e499e100735c14207ab25719d844f6b
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,13 @@ This project will adhere to [Semantic Versioning][1] once version 1.0.0 is relea
|
|
6
6
|
|
7
7
|
This document is formatted according to the principles of [Keep A CHANGELOG][2].
|
8
8
|
|
9
|
+
## [v0.14.11]
|
10
|
+
|
11
|
+
* Loosen childprocess dependency ([#658])
|
12
|
+
* Do not set binmode on output temp files, so automatic line ending conversion works ([#650])
|
13
|
+
* Improve deprecation suggestions ([#647])
|
14
|
+
* Backport fixes to code organization, layout and spelling ([#645])
|
15
|
+
|
9
16
|
## [v0.14.10]
|
10
17
|
|
11
18
|
* Backport replacement of problematic AnsiColor module with simple
|
@@ -667,6 +674,10 @@ This document is formatted according to the principles of [Keep A CHANGELOG][2].
|
|
667
674
|
|
668
675
|
<!-- issues & pull requests -->
|
669
676
|
|
677
|
+
[#658]: https://github.com/cucumber/aruba/pull/658
|
678
|
+
[#650]: https://github.com/cucumber/aruba/pull/650
|
679
|
+
[#647]: https://github.com/cucumber/aruba/pull/647
|
680
|
+
[#645]: https://github.com/cucumber/aruba/pull/645
|
670
681
|
[#642]: https://github.com/cucumber/aruba/pull/642
|
671
682
|
[#639]: https://github.com/cucumber/aruba/pull/639
|
672
683
|
[#638]: https://github.com/cucumber/aruba/pull/638
|
@@ -860,6 +871,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG][2].
|
|
860
871
|
|
861
872
|
<!-- Releases -->
|
862
873
|
|
874
|
+
[v0.14.11]: https://github.com/cucumber/aruba/compare/v0.14.10...v0.14.11
|
863
875
|
[v0.14.10]: https://github.com/cucumber/aruba/compare/v0.14.9...v0.14.10
|
864
876
|
[v0.14.9]: https://github.com/cucumber/aruba/compare/v0.14.8...v0.14.9
|
865
877
|
[v0.14.8]: https://github.com/cucumber/aruba/compare/v0.14.7...v0.14.8
|
data/Gemfile
CHANGED
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', '< 3.0.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'
|
data/lib/aruba/api/deprecated.rb
CHANGED
@@ -774,8 +774,7 @@ module Aruba
|
|
774
774
|
def assert_partial_output(expected, actual)
|
775
775
|
Aruba.platform.deprecated(
|
776
776
|
'The use of "#assert_partial_output" is deprecated.' \
|
777
|
-
' Use "expect(
|
778
|
-
' There are also special matchers for "stdout" and "stderr"'
|
777
|
+
' Use "expect(actual).to include_output_string partial" instead.'
|
779
778
|
)
|
780
779
|
|
781
780
|
actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
|
@@ -792,8 +791,7 @@ module Aruba
|
|
792
791
|
def assert_matching_output(expected, actual)
|
793
792
|
Aruba.platform.deprecated(
|
794
793
|
'The use of "#assert_matching_output" is deprecated.' \
|
795
|
-
' Use "expect(
|
796
|
-
' There are also special matchers for "stdout" and "stderr"'
|
794
|
+
' Use "expect(actual).to match_output partial" instead.'
|
797
795
|
)
|
798
796
|
|
799
797
|
actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
|
@@ -810,8 +808,7 @@ module Aruba
|
|
810
808
|
def assert_not_matching_output(expected, actual)
|
811
809
|
Aruba.platform.deprecated(
|
812
810
|
'The use of "#assert_not_matching_output" is deprecated.' \
|
813
|
-
' Use "expect(
|
814
|
-
' There are also special matchers for "stdout" and "stderr"'
|
811
|
+
' Use "expect(actual).not_to match_output partial" instead.'
|
815
812
|
)
|
816
813
|
|
817
814
|
actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
|
@@ -828,8 +825,7 @@ module Aruba
|
|
828
825
|
def assert_no_partial_output(unexpected, actual)
|
829
826
|
Aruba.platform.deprecated(
|
830
827
|
'The use of "#assert_no_partial_output" is deprecated.' \
|
831
|
-
' Use "expect(
|
832
|
-
' There are also special matchers for "stdout" and "stderr"'
|
828
|
+
' Use "expect(actual).not_to include_output_string partial" instead.'
|
833
829
|
)
|
834
830
|
|
835
831
|
actual.force_encoding(unexpected.encoding) if RUBY_VERSION >= "1.9"
|
@@ -851,8 +847,7 @@ module Aruba
|
|
851
847
|
def assert_partial_output_interactive(expected)
|
852
848
|
Aruba.platform.deprecated(
|
853
849
|
'The use of "#assert_partial_output_interactive" is deprecated.' \
|
854
|
-
' Use "expect(last_command_started).to have_output
|
855
|
-
' There are also special matchers for "stdout" and "stderr"'
|
850
|
+
' Use "expect(last_command_started).to have_output an_output_string_including partial" instead.'
|
856
851
|
)
|
857
852
|
|
858
853
|
Aruba.platform.unescape(last_command_started.stdout, aruba.config.keep_ansi).
|
@@ -1003,9 +998,6 @@ module Aruba
|
|
1003
998
|
# @deprecated
|
1004
999
|
#
|
1005
1000
|
# Default exit timeout for running commands with aruba
|
1006
|
-
#
|
1007
|
-
# Overwrite this method if you want a different timeout or set
|
1008
|
-
# `@aruba_timeout_seconds`.
|
1009
1001
|
def exit_timeout
|
1010
1002
|
Aruba.platform.deprecated(
|
1011
1003
|
'The use of "#exit_timeout" is deprecated.' \
|
@@ -3,7 +3,7 @@ if Aruba::VERSION < '1.0.0'
|
|
3
3
|
end
|
4
4
|
require 'aruba/generators/script_file'
|
5
5
|
|
6
|
-
When(/^I run `([^`]*)`$/)do |cmd|
|
6
|
+
When(/^I run `([^`]*)`$/) do |cmd|
|
7
7
|
cmd = sanitize_text(cmd)
|
8
8
|
run_command_and_stop(cmd, :fail_on_error => false)
|
9
9
|
end
|
@@ -26,13 +26,13 @@ When(/^I run the following (?:commands|script)(?: (?:with|in) `([^`]+)`)?:$/) do
|
|
26
26
|
step 'I run `myscript`'
|
27
27
|
end
|
28
28
|
|
29
|
-
When(/^I run `([^`]*)` interactively$/)do |cmd|
|
29
|
+
When(/^I run `([^`]*)` interactively$/) do |cmd|
|
30
30
|
cmd = sanitize_text(cmd)
|
31
31
|
@interactive = run_command(cmd)
|
32
32
|
end
|
33
33
|
|
34
34
|
# Merge interactive and background after refactoring with event queue
|
35
|
-
When(/^I run `([^`]*)` in background$/)do |cmd|
|
35
|
+
When(/^I run `([^`]*)` in background$/) do |cmd|
|
36
36
|
run_command(sanitize_text(cmd))
|
37
37
|
end
|
38
38
|
|
@@ -76,8 +76,10 @@ module Aruba
|
|
76
76
|
@stdout_file.sync = true
|
77
77
|
@stderr_file.sync = true
|
78
78
|
|
79
|
-
|
80
|
-
|
79
|
+
if RUBY_VERSION >= '1.9'
|
80
|
+
@stdout_file.set_encoding('ASCII-8BIT')
|
81
|
+
@stderr_file.set_encoding('ASCII-8BIT')
|
82
|
+
end
|
81
83
|
|
82
84
|
@exit_status = nil
|
83
85
|
@duplex = true
|
data/lib/aruba/version.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'aruba/api'
|
3
|
+
|
4
|
+
RSpec.describe Aruba::Api::Commands do
|
5
|
+
include_context 'uses aruba API'
|
6
|
+
|
7
|
+
describe '#run_command' do
|
8
|
+
before(:each){ @aruba.run_command 'cat' }
|
9
|
+
after(:each) { @aruba.all_commands.each(&:stop) }
|
10
|
+
|
11
|
+
it "responds to input" do
|
12
|
+
@aruba.type "Hello"
|
13
|
+
@aruba.type ""
|
14
|
+
expect(@aruba.last_command_started).to have_output "Hello"
|
15
|
+
end
|
16
|
+
|
17
|
+
it "responds to close_input" do
|
18
|
+
@aruba.type "Hello"
|
19
|
+
@aruba.close_input
|
20
|
+
expect(@aruba.last_command_started).to have_output "Hello"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "pipes data" do
|
24
|
+
@aruba.write_file(@file_name, "Hello\nWorld!")
|
25
|
+
@aruba.pipe_in_file(@file_name)
|
26
|
+
@aruba.close_input
|
27
|
+
expect(@aruba.last_command_started).to have_output "Hello\nWorld!"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/spec/aruba/api/core_spec.rb
CHANGED
@@ -5,6 +5,51 @@ require 'fileutils'
|
|
5
5
|
RSpec.describe Aruba::Api::Core do
|
6
6
|
include_context 'uses aruba API'
|
7
7
|
|
8
|
+
describe '#cd' do
|
9
|
+
before do
|
10
|
+
@directory_name = 'test_dir'
|
11
|
+
@directory_path = File.join(@aruba.aruba.current_directory, @directory_name)
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'with a block given' do
|
15
|
+
it 'runs the passed block in the given directory' do
|
16
|
+
@aruba.create_directory @directory_name
|
17
|
+
full_path = File.expand_path(@directory_path)
|
18
|
+
@aruba.cd @directory_name do
|
19
|
+
expect(Dir.pwd).to eq full_path
|
20
|
+
end
|
21
|
+
expect(Dir.pwd).not_to eq full_path
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'sets directory environment in the passed block' do
|
25
|
+
@aruba.create_directory @directory_name
|
26
|
+
old_pwd = ENV['PWD']
|
27
|
+
full_path = File.expand_path(@directory_path)
|
28
|
+
@aruba.cd @directory_name do
|
29
|
+
expect(ENV['PWD']).to eq full_path
|
30
|
+
expect(ENV['OLDPWD']).to eq old_pwd
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'sets aruba environment in the passed block' do
|
35
|
+
@aruba.create_directory @directory_name
|
36
|
+
@aruba.set_environment_variable('FOO', 'bar')
|
37
|
+
@aruba.cd @directory_name do
|
38
|
+
expect(ENV['FOO']).to eq 'bar'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'does not touch other environment variables in the passed block' do
|
43
|
+
keys = ENV.keys - ['PWD', 'OLDPWD']
|
44
|
+
old_values = ENV.values_at(*keys)
|
45
|
+
@aruba.create_directory @directory_name
|
46
|
+
@aruba.cd @directory_name do
|
47
|
+
expect(ENV.values_at(*keys)).to eq old_values
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
8
53
|
describe '#expand_path' do
|
9
54
|
context 'when file_name is given' do
|
10
55
|
it { expect(@aruba.expand_path(@file_name)).to eq File.expand_path(@file_path) }
|
@@ -82,61 +127,58 @@ RSpec.describe Aruba::Api::Core do
|
|
82
127
|
end
|
83
128
|
end
|
84
129
|
|
85
|
-
describe '#
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
end
|
130
|
+
describe '#with_environment' do
|
131
|
+
it 'modifies env for block' do
|
132
|
+
variable = 'THIS_IS_A_ENV_VAR_1'
|
133
|
+
ENV[variable] = '1'
|
90
134
|
|
91
|
-
|
92
|
-
|
93
|
-
@aruba.create_directory @directory_name
|
94
|
-
full_path = File.expand_path(@directory_path)
|
95
|
-
@aruba.cd @directory_name do
|
96
|
-
expect(Dir.pwd).to eq full_path
|
97
|
-
end
|
98
|
-
expect(Dir.pwd).not_to eq full_path
|
135
|
+
@aruba.with_environment variable => '0' do
|
136
|
+
expect(ENV[variable]).to eq '0'
|
99
137
|
end
|
100
138
|
|
101
|
-
|
102
|
-
|
103
|
-
old_pwd = ENV['PWD']
|
104
|
-
full_path = File.expand_path(@directory_path)
|
105
|
-
@aruba.cd @directory_name do
|
106
|
-
expect(ENV['PWD']).to eq full_path
|
107
|
-
expect(ENV['OLDPWD']).to eq old_pwd
|
108
|
-
end
|
109
|
-
end
|
139
|
+
expect(ENV[variable]).to eq '1'
|
140
|
+
end
|
110
141
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
142
|
+
it 'works together with #set_environment_variable' do
|
143
|
+
variable = 'THIS_IS_A_ENV_VAR_2'
|
144
|
+
@aruba.set_environment_variable variable, '1'
|
145
|
+
|
146
|
+
@aruba.with_environment do
|
147
|
+
expect(ENV[variable]).to eq '1'
|
148
|
+
@aruba.set_environment_variable variable, '0'
|
149
|
+
@aruba.with_environment do
|
150
|
+
expect(ENV[variable]).to eq '0'
|
116
151
|
end
|
152
|
+
expect(ENV[variable]).to eq '1'
|
117
153
|
end
|
154
|
+
end
|
118
155
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
156
|
+
it 'works with a mix of ENV and #set_environment_variable' do
|
157
|
+
variable = 'THIS_IS_A_ENV_VAR_3'
|
158
|
+
@aruba.set_environment_variable variable, '1'
|
159
|
+
ENV[variable] = '2'
|
160
|
+
expect(ENV[variable]).to eq '2'
|
161
|
+
|
162
|
+
@aruba.with_environment do
|
163
|
+
expect(ENV[variable]).to eq '1'
|
164
|
+
@aruba.set_environment_variable variable, '0'
|
165
|
+
@aruba.with_environment do
|
166
|
+
expect(ENV[variable]).to eq '0'
|
125
167
|
end
|
168
|
+
expect(ENV[variable]).to eq '1'
|
126
169
|
end
|
170
|
+
expect(ENV[variable]).to eq '2'
|
127
171
|
end
|
128
|
-
end
|
129
172
|
|
130
|
-
|
131
|
-
|
132
|
-
variable = '
|
133
|
-
ENV[variable]
|
173
|
+
it 'keeps values not set in argument' do
|
174
|
+
variable = 'THIS_IS_A_ENV_VAR_4'
|
175
|
+
ENV[variable] = '2'
|
176
|
+
expect(ENV[variable]).to eq '2'
|
134
177
|
|
135
|
-
@aruba.with_environment
|
136
|
-
expect(ENV[variable]).to eq '
|
178
|
+
@aruba.with_environment do
|
179
|
+
expect(ENV[variable]).to eq '2'
|
137
180
|
end
|
138
|
-
|
139
|
-
expect(ENV[variable]).to eq '1'
|
181
|
+
expect(ENV[variable]).to eq '2'
|
140
182
|
end
|
141
183
|
end
|
142
184
|
end
|
data/spec/aruba/api_spec.rb
CHANGED
@@ -36,30 +36,6 @@ describe Aruba::Api do
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
describe '#run_command' do
|
40
|
-
before(:each){ @aruba.run_command 'cat' }
|
41
|
-
after(:each) { @aruba.all_commands.each(&:stop) }
|
42
|
-
|
43
|
-
it "respond to input" do
|
44
|
-
@aruba.type "Hello"
|
45
|
-
@aruba.type ""
|
46
|
-
expect(@aruba.last_command_started).to have_output "Hello"
|
47
|
-
end
|
48
|
-
|
49
|
-
it "respond to close_input" do
|
50
|
-
@aruba.type "Hello"
|
51
|
-
@aruba.close_input
|
52
|
-
expect(@aruba.last_command_started).to have_output "Hello"
|
53
|
-
end
|
54
|
-
|
55
|
-
it "pipes data" do
|
56
|
-
@aruba.write_file(@file_name, "Hello\nWorld!")
|
57
|
-
@aruba.pipe_in_file(@file_name)
|
58
|
-
@aruba.close_input
|
59
|
-
expect(@aruba.last_command_started).to have_output "Hello\nWorld!"
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
39
|
describe 'fixtures' do
|
64
40
|
let(:api) do
|
65
41
|
klass = Class.new do
|
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.14.
|
4
|
+
version: 0.14.11
|
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: 2019-
|
16
|
+
date: 2019-07-19 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: cucumber
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
version: 0.6.3
|
39
39
|
- - "<"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 3.0.0
|
42
42
|
type: :runtime
|
43
43
|
prerelease: false
|
44
44
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -48,7 +48,7 @@ dependencies:
|
|
48
48
|
version: 0.6.3
|
49
49
|
- - "<"
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version:
|
51
|
+
version: 3.0.0
|
52
52
|
- !ruby/object:Gem::Dependency
|
53
53
|
name: ffi
|
54
54
|
requirement: !ruby/object:Gem::Requirement
|
@@ -257,7 +257,6 @@ files:
|
|
257
257
|
- features/step_definitions/hooks.rb
|
258
258
|
- features/support/aruba.rb
|
259
259
|
- features/support/env.rb
|
260
|
-
- features/support/jruby.rb
|
261
260
|
- features/support/simplecov_setup.rb
|
262
261
|
- fixtures/cli-app/.gitignore
|
263
262
|
- fixtures/cli-app/.rspec
|
@@ -401,6 +400,7 @@ files:
|
|
401
400
|
- script/console
|
402
401
|
- script/test
|
403
402
|
- spec/aruba/api/bundler_spec.rb
|
403
|
+
- spec/aruba/api/commands_spec.rb
|
404
404
|
- spec/aruba/api/core_spec.rb
|
405
405
|
- spec/aruba/api/deprecated_spec.rb
|
406
406
|
- spec/aruba/api/filesystem_spec.rb
|
@@ -485,5 +485,5 @@ requirements: []
|
|
485
485
|
rubygems_version: 3.0.3
|
486
486
|
signing_key:
|
487
487
|
specification_version: 4
|
488
|
-
summary: aruba-0.14.
|
488
|
+
summary: aruba-0.14.11
|
489
489
|
test_files: []
|