aruba 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -7
- data/History.md +7 -3
- data/README.md +1 -1
- data/aruba.gemspec +3 -3
- data/cucumber.yml +3 -2
- data/features/interactive.feature +1 -1
- data/features/utf-8.feature +14 -0
- data/lib/aruba/api.rb +5 -0
- data/lib/aruba/spawn_process.rb +32 -14
- metadata +46 -40
- checksums.yaml +0 -7
data/.travis.yml
CHANGED
data/History.md
CHANGED
@@ -1,13 +1,17 @@
|
|
1
|
-
##
|
1
|
+
## [master](https://github.com/cucumber/aruba/compare/v0.5.2...master)
|
2
|
+
* Fix for UTF-8 support (#151 Matt Wynne, Jarl Friis)
|
3
|
+
* Fix for open file leakage (#150 @JonRowe)
|
4
|
+
|
5
|
+
## [v0.5.2](https://github.com/cucumber/aruba/compare/v0.5.1...v0.5.2)
|
2
6
|
|
3
7
|
* Plugin API for greater speed. Test Ruby CLI programs in a single Ruby process (#148 Aslak Hellesøy)
|
4
8
|
* Fix memory leak when several commands are executed in a single run (#144 @y-higuchi)
|
5
9
|
|
6
|
-
##
|
10
|
+
## [v0.5.1](https://github.com/cucumber/aruba/compare/v0.5.0...v0.5.1)
|
7
11
|
* Individual timeout settings when running commands (#124 Jarl Friis)
|
8
12
|
* Varous fixes for JRuby tests, should now work on more versions of JRuby
|
9
13
|
|
10
|
-
##
|
14
|
+
## [v0.5.0](https://github.com/cucumber/aruba/compare/v0.4.10...v0.5.0)
|
11
15
|
* Add #with_file_content to the DSL (#110 Pavel Argentov)
|
12
16
|
* Make JRuby performance tweaks optional (#102 Taylor Carpenter, #125 Andy Lindeman)
|
13
17
|
* Add assert_partial_output_interactive so you can peek at the output from a running process (#104 Taylor Carpenter)
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[![Build Status](https://secure.travis-ci.org/cucumber/aruba.png)](http://travis-ci.org/cucumber/aruba) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/cucumber/aruba)
|
2
2
|
|
3
|
-
Aruba is Cucumber extension for
|
3
|
+
Aruba is Cucumber extension for testing command line applications written in any programming language. Features at a glance:
|
4
4
|
|
5
5
|
* Test any command line application
|
6
6
|
* Manipulate the file system
|
data/aruba.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'aruba'
|
5
|
-
s.version = '0.5.
|
5
|
+
s.version = '0.5.3'
|
6
6
|
s.authors = ["Aslak Hellesøy", "David Chelimsky", "Mike Sassak", "Matt Wynne"]
|
7
7
|
s.description = 'CLI Steps for Cucumber, hand-crafted for you in Aruba'
|
8
8
|
s.summary = "aruba-#{s.version}"
|
@@ -10,10 +10,10 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.homepage = 'http://github.com/cucumber/aruba'
|
11
11
|
|
12
12
|
s.add_runtime_dependency 'cucumber', '>= 1.1.1'
|
13
|
-
s.add_runtime_dependency 'childprocess', '
|
13
|
+
s.add_runtime_dependency 'childprocess', '>= 0.3.6'
|
14
14
|
s.add_runtime_dependency 'rspec-expectations', '>= 2.7.0'
|
15
15
|
s.add_development_dependency 'bcat', '>= 0.6.1'
|
16
|
-
s.add_development_dependency 'kramdown', '
|
16
|
+
s.add_development_dependency 'kramdown', '>= 0.14'
|
17
17
|
s.add_development_dependency 'rake', '>= 0.9.2'
|
18
18
|
s.add_development_dependency 'rspec', '>= 2.7.0'
|
19
19
|
|
data/cucumber.yml
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
<%
|
2
|
+
java_version = (RUBY_DESCRIPTION.match(/.*?on.*?(1\.[\d]\..*? )/))[1] if defined?(JRUBY_VERSION)
|
2
3
|
std_opts = "--color --tags ~@wip"
|
3
|
-
std_opts << " --tags ~@wip-jruby-1.6" if defined?(JRUBY_VERSION) && (
|
4
|
+
std_opts << " --tags ~@wip-jruby-java-1.6" if defined?(JRUBY_VERSION) && (java_version < '1.7.0')
|
4
5
|
|
5
6
|
wip_opts = "--color --tags @wip:3"
|
6
|
-
wip_opts = "--color --tags @wip:3,@wip-jruby-1.6:3" if defined?(JRUBY_VERSION) && (
|
7
|
+
wip_opts = "--color --tags @wip:3,@wip-jruby-java-1.6:3" if defined?(JRUBY_VERSION) && (java_version < '1.7.0')
|
7
8
|
%>
|
8
9
|
default: <%= std_opts %>
|
9
10
|
wip: --wip <%= wip_opts %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Feature: UTF-8
|
2
|
+
|
3
|
+
Scenario: Write then assert on the content of a file with UTF-8 characters in
|
4
|
+
Given a file named "turning-japanese" with:
|
5
|
+
"""
|
6
|
+
フィーチャ
|
7
|
+
|
8
|
+
"""
|
9
|
+
And I run `cat turning-japanese`
|
10
|
+
Then the output should contain exactly:
|
11
|
+
"""
|
12
|
+
フィーチャ
|
13
|
+
|
14
|
+
"""
|
data/lib/aruba/api.rb
CHANGED
@@ -183,22 +183,27 @@ module Aruba
|
|
183
183
|
end
|
184
184
|
|
185
185
|
def assert_exact_output(expected, actual)
|
186
|
+
actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
|
186
187
|
unescape(actual).should == unescape(expected)
|
187
188
|
end
|
188
189
|
|
189
190
|
def assert_partial_output(expected, actual)
|
191
|
+
actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
|
190
192
|
unescape(actual).should include(unescape(expected))
|
191
193
|
end
|
192
194
|
|
193
195
|
def assert_matching_output(expected, actual)
|
196
|
+
actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
|
194
197
|
unescape(actual).should =~ /#{unescape(expected)}/m
|
195
198
|
end
|
196
199
|
|
197
200
|
def assert_not_matching_output(expected, actual)
|
201
|
+
actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
|
198
202
|
unescape(actual).should_not =~ /#{unescape(expected)}/m
|
199
203
|
end
|
200
204
|
|
201
205
|
def assert_no_partial_output(unexpected, actual)
|
206
|
+
actual.force_encoding(unexpected.encoding) if RUBY_VERSION >= "1.9"
|
202
207
|
if Regexp === unexpected
|
203
208
|
unescape(actual).should_not =~ unexpected
|
204
209
|
else
|
data/lib/aruba/spawn_process.rb
CHANGED
@@ -14,6 +14,8 @@ module Aruba
|
|
14
14
|
@cmd = cmd
|
15
15
|
@process = nil
|
16
16
|
@exit_code = nil
|
17
|
+
@output_cache = nil
|
18
|
+
@error_cache = nil
|
17
19
|
end
|
18
20
|
|
19
21
|
def run!(&block)
|
@@ -41,17 +43,11 @@ module Aruba
|
|
41
43
|
end
|
42
44
|
|
43
45
|
def stdout
|
44
|
-
wait_for_io
|
45
|
-
@out.rewind
|
46
|
-
@out.read
|
47
|
-
end
|
46
|
+
wait_for_io { read(@out) } || @output_cache
|
48
47
|
end
|
49
48
|
|
50
49
|
def stderr
|
51
|
-
wait_for_io
|
52
|
-
@err.rewind
|
53
|
-
@err.read
|
54
|
-
end
|
50
|
+
wait_for_io { read(@err) } || @error_cache
|
55
51
|
end
|
56
52
|
|
57
53
|
def read_stdout
|
@@ -66,26 +62,48 @@ module Aruba
|
|
66
62
|
unless @process.exited?
|
67
63
|
@process.poll_for_exit(@exit_timeout)
|
68
64
|
end
|
69
|
-
reader.stdout stdout
|
70
|
-
reader.stderr stderr
|
71
65
|
@exit_code = @process.exit_code
|
72
66
|
@process = nil
|
67
|
+
close_and_cache_out
|
68
|
+
close_and_cache_err
|
69
|
+
if reader
|
70
|
+
reader.stdout stdout
|
71
|
+
reader.stderr stderr
|
72
|
+
end
|
73
73
|
@exit_code
|
74
74
|
end
|
75
75
|
|
76
76
|
def terminate
|
77
77
|
if @process
|
78
|
-
stdout && stderr # flush output
|
79
78
|
@process.stop
|
80
|
-
|
79
|
+
stop nil
|
81
80
|
end
|
82
81
|
end
|
83
82
|
|
84
83
|
private
|
85
84
|
|
86
85
|
def wait_for_io(&block)
|
87
|
-
|
88
|
-
|
86
|
+
if @process
|
87
|
+
sleep @io_wait
|
88
|
+
yield
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def read(io)
|
93
|
+
io.rewind
|
94
|
+
io.read
|
95
|
+
end
|
96
|
+
|
97
|
+
def close_and_cache_out
|
98
|
+
@output_cache = read @out
|
99
|
+
@out.close
|
100
|
+
@out = nil
|
101
|
+
end
|
102
|
+
|
103
|
+
def close_and_cache_err
|
104
|
+
@error_cache = read @err
|
105
|
+
@err.close
|
106
|
+
@err = nil
|
89
107
|
end
|
90
108
|
|
91
109
|
end
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aruba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Aslak Hellesøy
|
@@ -11,104 +12,118 @@ authors:
|
|
11
12
|
autorequire:
|
12
13
|
bindir: bin
|
13
14
|
cert_chain: []
|
14
|
-
date: 2013-
|
15
|
+
date: 2013-05-17 00:00:00.000000000 Z
|
15
16
|
dependencies:
|
16
17
|
- !ruby/object:Gem::Dependency
|
17
18
|
name: cucumber
|
18
19
|
requirement: !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
19
21
|
requirements:
|
20
|
-
- - '>='
|
22
|
+
- - ! '>='
|
21
23
|
- !ruby/object:Gem::Version
|
22
24
|
version: 1.1.1
|
23
25
|
type: :runtime
|
24
26
|
prerelease: false
|
25
27
|
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
26
29
|
requirements:
|
27
|
-
- - '>='
|
30
|
+
- - ! '>='
|
28
31
|
- !ruby/object:Gem::Version
|
29
32
|
version: 1.1.1
|
30
33
|
- !ruby/object:Gem::Dependency
|
31
34
|
name: childprocess
|
32
35
|
requirement: !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
33
37
|
requirements:
|
34
|
-
- -
|
38
|
+
- - ! '>='
|
35
39
|
- !ruby/object:Gem::Version
|
36
40
|
version: 0.3.6
|
37
41
|
type: :runtime
|
38
42
|
prerelease: false
|
39
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
40
45
|
requirements:
|
41
|
-
- -
|
46
|
+
- - ! '>='
|
42
47
|
- !ruby/object:Gem::Version
|
43
48
|
version: 0.3.6
|
44
49
|
- !ruby/object:Gem::Dependency
|
45
50
|
name: rspec-expectations
|
46
51
|
requirement: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
47
53
|
requirements:
|
48
|
-
- - '>='
|
54
|
+
- - ! '>='
|
49
55
|
- !ruby/object:Gem::Version
|
50
56
|
version: 2.7.0
|
51
57
|
type: :runtime
|
52
58
|
prerelease: false
|
53
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
54
61
|
requirements:
|
55
|
-
- - '>='
|
62
|
+
- - ! '>='
|
56
63
|
- !ruby/object:Gem::Version
|
57
64
|
version: 2.7.0
|
58
65
|
- !ruby/object:Gem::Dependency
|
59
66
|
name: bcat
|
60
67
|
requirement: !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
61
69
|
requirements:
|
62
|
-
- - '>='
|
70
|
+
- - ! '>='
|
63
71
|
- !ruby/object:Gem::Version
|
64
72
|
version: 0.6.1
|
65
73
|
type: :development
|
66
74
|
prerelease: false
|
67
75
|
version_requirements: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
68
77
|
requirements:
|
69
|
-
- - '>='
|
78
|
+
- - ! '>='
|
70
79
|
- !ruby/object:Gem::Version
|
71
80
|
version: 0.6.1
|
72
81
|
- !ruby/object:Gem::Dependency
|
73
82
|
name: kramdown
|
74
83
|
requirement: !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
75
85
|
requirements:
|
76
|
-
- -
|
86
|
+
- - ! '>='
|
77
87
|
- !ruby/object:Gem::Version
|
78
88
|
version: '0.14'
|
79
89
|
type: :development
|
80
90
|
prerelease: false
|
81
91
|
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
82
93
|
requirements:
|
83
|
-
- -
|
94
|
+
- - ! '>='
|
84
95
|
- !ruby/object:Gem::Version
|
85
96
|
version: '0.14'
|
86
97
|
- !ruby/object:Gem::Dependency
|
87
98
|
name: rake
|
88
99
|
requirement: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
89
101
|
requirements:
|
90
|
-
- - '>='
|
102
|
+
- - ! '>='
|
91
103
|
- !ruby/object:Gem::Version
|
92
104
|
version: 0.9.2
|
93
105
|
type: :development
|
94
106
|
prerelease: false
|
95
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
96
109
|
requirements:
|
97
|
-
- - '>='
|
110
|
+
- - ! '>='
|
98
111
|
- !ruby/object:Gem::Version
|
99
112
|
version: 0.9.2
|
100
113
|
- !ruby/object:Gem::Dependency
|
101
114
|
name: rspec
|
102
115
|
requirement: !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
103
117
|
requirements:
|
104
|
-
- - '>='
|
118
|
+
- - ! '>='
|
105
119
|
- !ruby/object:Gem::Version
|
106
120
|
version: 2.7.0
|
107
121
|
type: :development
|
108
122
|
prerelease: false
|
109
123
|
version_requirements: !ruby/object:Gem::Requirement
|
124
|
+
none: false
|
110
125
|
requirements:
|
111
|
-
- - '>='
|
126
|
+
- - ! '>='
|
112
127
|
- !ruby/object:Gem::Version
|
113
128
|
version: 2.7.0
|
114
129
|
description: CLI Steps for Cucumber, hand-crafted for you in Aruba
|
@@ -142,6 +157,7 @@ files:
|
|
142
157
|
- features/support/custom_main.rb
|
143
158
|
- features/support/env.rb
|
144
159
|
- features/support/jruby.rb
|
160
|
+
- features/utf-8.feature
|
145
161
|
- lib/aruba.rb
|
146
162
|
- lib/aruba/api.rb
|
147
163
|
- lib/aruba/config.rb
|
@@ -172,43 +188,33 @@ files:
|
|
172
188
|
- templates/main.erb
|
173
189
|
homepage: http://github.com/cucumber/aruba
|
174
190
|
licenses: []
|
175
|
-
metadata: {}
|
176
191
|
post_install_message:
|
177
192
|
rdoc_options:
|
178
193
|
- --charset=UTF-8
|
179
194
|
require_paths:
|
180
195
|
- lib
|
181
196
|
required_ruby_version: !ruby/object:Gem::Requirement
|
197
|
+
none: false
|
182
198
|
requirements:
|
183
|
-
- - '>='
|
199
|
+
- - ! '>='
|
184
200
|
- !ruby/object:Gem::Version
|
185
201
|
version: '0'
|
202
|
+
segments:
|
203
|
+
- 0
|
204
|
+
hash: 4547606792464091190
|
186
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
|
+
none: false
|
187
207
|
requirements:
|
188
|
-
- - '>='
|
208
|
+
- - ! '>='
|
189
209
|
- !ruby/object:Gem::Version
|
190
210
|
version: '0'
|
211
|
+
segments:
|
212
|
+
- 0
|
213
|
+
hash: 4547606792464091190
|
191
214
|
requirements: []
|
192
215
|
rubyforge_project:
|
193
|
-
rubygems_version:
|
216
|
+
rubygems_version: 1.8.23
|
194
217
|
signing_key:
|
195
|
-
specification_version:
|
196
|
-
summary: aruba-0.5.
|
197
|
-
test_files:
|
198
|
-
- features/before_cmd_hooks.feature
|
199
|
-
- features/custom_ruby_process.feature
|
200
|
-
- features/exit_statuses.feature
|
201
|
-
- features/file_system_commands.feature
|
202
|
-
- features/flushing.feature
|
203
|
-
- features/interactive.feature
|
204
|
-
- features/no_clobber.feature
|
205
|
-
- features/output.feature
|
206
|
-
- features/step_definitions/aruba_dev_steps.rb
|
207
|
-
- features/support/custom_main.rb
|
208
|
-
- features/support/env.rb
|
209
|
-
- features/support/jruby.rb
|
210
|
-
- spec/aruba/api_spec.rb
|
211
|
-
- spec/aruba/hooks_spec.rb
|
212
|
-
- spec/aruba/jruby_spec.rb
|
213
|
-
- spec/aruba/spawn_process_spec.rb
|
214
|
-
- spec/spec_helper.rb
|
218
|
+
specification_version: 3
|
219
|
+
summary: aruba-0.5.3
|
220
|
+
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: c32a3208631d64e4bb80c234b0631c7747f9e173
|
4
|
-
data.tar.gz: c8badeb14b86f1e2c1654127a2042adbdf223614
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 02ccf28c607e88a1216c32c30c52dd8414fb4f26b19035378c7a891587148aa147223e4d1eb24204742a1097a3e168628201d6009f4a2198d5b2b73a1486b627
|
7
|
-
data.tar.gz: ea7267f34b7e1a6352d84377b58500554dcf5b9d6af94d0b2593224e5413932d5c534270b80512dfec76501d161f6fa7e331d96c36d73d4c40b056095a898e89
|