aruba-jbb 0.2.6.5 → 0.2.6.7
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +8 -0
- data/README.rdoc +7 -3
- data/aruba-jbb.gemspec +2 -2
- data/features/flushing.feature +25 -0
- data/features/output.feature +2 -1
- data/features/step_definitions/aruba_dev_steps.rb +4 -0
- data/lib/aruba/api.rb +26 -7
- metadata +6 -3
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
== 0.2.6.7 msassak
|
2
|
+
|
3
|
+
=== Bug fixes
|
4
|
+
* Outputting large amounts of data causes BackgroundProcess#exitstatus to hang (#18 Mike Sassak)
|
5
|
+
|
6
|
+
== 0.2.6.6 jbb
|
7
|
+
* reverted run api method to old implementation and removed background_process
|
8
|
+
|
1
9
|
== 0.2.6.5 jbb
|
2
10
|
* removed lib/aruba-jbb.rb file
|
3
11
|
|
data/README.rdoc
CHANGED
@@ -66,8 +66,8 @@ This will cause Aruba to create soft links called <tt>./tmp/aruba/bin</tt>,
|
|
66
66
|
<tt>./tmp/aruba/config</tt> and <tt>./tmp/aruba/lib</tt> each pointing
|
67
67
|
to the corresponding directory in the user's cwd.
|
68
68
|
|
69
|
-
Upstream addressed the more
|
70
|
-
by adding <code>@bin</code> tag which appends <code>./bin</code> to Cucumber's
|
69
|
+
Upstream addressed the more limited problem of locating <code>./bin</code>
|
70
|
+
by adding a <code>@bin</code> tag which appends <code>./bin</code> to Cucumber's
|
71
71
|
LOADPATH. This technique is supported by Aruba-jbb as well.
|
72
72
|
|
73
73
|
|
@@ -82,7 +82,11 @@ The last version of this fork having them was 0.2.6.
|
|
82
82
|
To test against specific versions of Ruby using RVM you are advised to use
|
83
83
|
following idiom (note the comma between Ruby version numbers):
|
84
84
|
|
85
|
-
<code>$ rvm 1.9.2,1.8.7 exec cucumber
|
85
|
+
<code>$ rvm 1.9.2,1.8.7 exec rake cucumber:wip </code>
|
86
|
+
|
87
|
+
or
|
88
|
+
|
89
|
+
<code>$ rvm 1.9.2,1.8.7 exec cucumber </code>
|
86
90
|
|
87
91
|
|
88
92
|
== Getting more output with tags.
|
data/aruba-jbb.gemspec
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{aruba-jbb}
|
5
|
-
s.version = "0.2.6.
|
5
|
+
s.version = "0.2.6.7"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["Aslak Hellesøy", "David Chelimsky", "James B. Byrne"]
|
8
|
+
s.authors = ["Aslak Hellesøy", "David Chelimsky", "James B. Byrne", "Mike Sassak"]
|
9
9
|
s.date = %q{2010-09-29}
|
10
10
|
s.description = %q{Fork of Aruba, Cucumber steps for testing CLI applications.}
|
11
11
|
s.email = %q{cukes@googlegroups.com}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Feature: Flushing output
|
2
|
+
|
3
|
+
In order to test processes that output a lot of data
|
4
|
+
As a developer using Aruba
|
5
|
+
I want to make sure that large amounts of output aren't buffered
|
6
|
+
|
7
|
+
|
8
|
+
Scenario: Handle a large STDOUT data stream
|
9
|
+
#When I run "ruby -e \" 500.times.each { |i| puts %Q(rword #{i+1} ) * 6 }\""
|
10
|
+
When I run "ruby -e \" 1500.times { puts %Q(rword ) * 12 }\""
|
11
|
+
Then the stdout should contain "rword"
|
12
|
+
|
13
|
+
|
14
|
+
Scenario: Tons of output
|
15
|
+
When I run "ruby -e 'puts :a.to_s * 65536'"
|
16
|
+
Then the output should contain "a"
|
17
|
+
And the output should be 65537 bytes long
|
18
|
+
|
19
|
+
|
20
|
+
Scenario: Tons of interactive output
|
21
|
+
When I run "ruby -e 'len = gets.chomp; puts :a.to_s * len.to_i'" interactively
|
22
|
+
And I type "65536"
|
23
|
+
Then the output should contain "a"
|
24
|
+
And the output should be 65537 bytes long
|
25
|
+
|
data/features/output.feature
CHANGED
@@ -5,7 +5,8 @@ Feature: Output
|
|
5
5
|
I want to use the "the output should contain" step
|
6
6
|
|
7
7
|
Scenario: Run unknown command
|
8
|
-
When I run "neverever gonna work"
|
8
|
+
When I run "neverever gonna work"
|
9
|
+
#""" sh: neverever: command not found """ for shell run implementation
|
9
10
|
Then the output should contain:
|
10
11
|
"""
|
11
12
|
No such file or directory - neverever gonna work
|
@@ -77,3 +77,7 @@ end
|
|
77
77
|
When /^the following step should fail with Spec::Expectations::ExpectationNotMetError:$/ do |multiline_step|
|
78
78
|
proc {steps multiline_step}.should raise_error(RSpec::Expectations::ExpectationNotMetError)
|
79
79
|
end
|
80
|
+
|
81
|
+
Then /^the output should be (\d+) bytes long$/ do |length|
|
82
|
+
combined_output.length.should == length.to_i
|
83
|
+
end
|
data/lib/aruba/api.rb
CHANGED
@@ -149,8 +149,6 @@ module Aruba
|
|
149
149
|
|
150
150
|
|
151
151
|
def combined_output
|
152
|
-
@last_stdout ||= ""
|
153
|
-
@last_stderr ||= ""
|
154
152
|
if @interactive
|
155
153
|
interactive_output
|
156
154
|
else
|
@@ -254,7 +252,7 @@ module Aruba
|
|
254
252
|
|
255
253
|
|
256
254
|
def interactive_output
|
257
|
-
if @interactive
|
255
|
+
@_interactive ||= if @interactive
|
258
256
|
@interactive.wait(1) || @interactive.kill('TERM')
|
259
257
|
@interactive.stdout.read
|
260
258
|
else
|
@@ -324,22 +322,43 @@ module Aruba
|
|
324
322
|
ENV[key] = value
|
325
323
|
end
|
326
324
|
end
|
327
|
-
|
328
|
-
|
325
|
+
|
329
326
|
def run(cmd, fail_on_error=true)
|
330
327
|
cmd = detect_ruby(cmd)
|
331
328
|
|
329
|
+
|
332
330
|
in_current_dir do
|
333
331
|
announce_or_puts("$ cd #{Dir.pwd}") if @announce_dir
|
334
332
|
announce_or_puts("$ #{cmd}") if @announce_cmd
|
335
333
|
ps = BackgroundProcess.run(cmd)
|
336
|
-
@
|
337
|
-
@last_stdout = ps.stdout.read
|
334
|
+
@last_stdout = ps.stdout.read
|
338
335
|
announce_or_puts(@last_stdout) if @announce_stdout
|
339
336
|
@last_stderr = ps.stderr.read
|
340
337
|
announce_or_puts(@last_stderr) if @announce_stderr
|
338
|
+
@last_exit_status = ps.exitstatus # Waits for process to finish
|
339
|
+
end
|
340
|
+
|
341
|
+
=begin
|
342
|
+
stderr_file = Tempfile.new('cucumber')
|
343
|
+
stderr_file.close
|
344
|
+
in_current_dir do
|
345
|
+
announce_or_puts("$ cd #{Dir.pwd}") if @announce_dir
|
346
|
+
announce_or_puts("$ #{cmd}") if @announce_cmd
|
347
|
+
|
348
|
+
mode = RUBY_VERSION =~ /^1\.9/ ? {:external_encoding=>"UTF-8"} : 'r'
|
349
|
+
|
350
|
+
IO.popen("unset BUNDLE_PATH && unset BUNDLE_BIN_PATH && unset BUNDLE_GEMFILE && #{cmd} 2> #{stderr_file.path}", mode) do |io|
|
351
|
+
@last_stdout = io.read
|
352
|
+
announce_or_puts(@last_stdout) if @announce_stdout
|
353
|
+
end
|
354
|
+
|
355
|
+
@last_exit_status = $?.exitstatus
|
341
356
|
end
|
342
357
|
|
358
|
+
@last_stderr = IO.read(stderr_file.path)
|
359
|
+
announce_or_puts(@last_stderr) if @announce_stderr
|
360
|
+
=end
|
361
|
+
|
343
362
|
if(@last_exit_status != 0 && fail_on_error)
|
344
363
|
fail("Exit status was #{@last_exit_status}. Output:\n#{combined_output}")
|
345
364
|
end
|
metadata
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aruba-jbb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 73
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
9
|
- 6
|
10
|
-
-
|
11
|
-
version: 0.2.6.
|
10
|
+
- 7
|
11
|
+
version: 0.2.6.7
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- "Aslak Helles\xC3\xB8y"
|
15
15
|
- David Chelimsky
|
16
16
|
- James B. Byrne
|
17
|
+
- Mike Sassak
|
17
18
|
autorequire:
|
18
19
|
bindir: bin
|
19
20
|
cert_chain: []
|
@@ -93,6 +94,7 @@ files:
|
|
93
94
|
- config/.gitignore
|
94
95
|
- features/exit_statuses.feature
|
95
96
|
- features/file_system_commands.feature
|
97
|
+
- features/flushing.feature
|
96
98
|
- features/interactive.feature
|
97
99
|
- features/output.feature
|
98
100
|
- features/step_definitions/aruba_dev_steps.rb
|
@@ -140,6 +142,7 @@ summary: Cucumber steps for testing external processes from the CLI
|
|
140
142
|
test_files:
|
141
143
|
- features/exit_statuses.feature
|
142
144
|
- features/file_system_commands.feature
|
145
|
+
- features/flushing.feature
|
143
146
|
- features/interactive.feature
|
144
147
|
- features/output.feature
|
145
148
|
- features/step_definitions/aruba_dev_steps.rb
|