aruba-jbb 0.2.6.12 → 0.2.6.13
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.
- data/History.txt +9 -0
- data/aruba-jbb.gemspec +2 -2
- data/features/output.feature +10 -0
- data/features/std_out.feature +18 -0
- data/lib/aruba/api.rb +35 -2
- data/lib/aruba/cucumber_steps.rb +18 -3
- metadata +4 -4
data/History.txt
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
== 0.2.6.13 jbb
|
|
2
|
+
* added new api methods
|
|
3
|
+
* refactored matchers for new api methods
|
|
4
|
+
* added additional tests for stderr and stdout matchers
|
|
5
|
+
|
|
6
|
+
== Bug fixes
|
|
7
|
+
* fixed rspec syntax (no #should != instead must use #should_not ==)
|
|
8
|
+
* fixed some documentation errors and omissions
|
|
9
|
+
|
|
1
10
|
== 0.2.6.12 jbb
|
|
2
11
|
* merged aslak 0.2.4
|
|
3
12
|
* added remove_env to api
|
data/aruba-jbb.gemspec
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
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.13"
|
|
6
6
|
s.authors = ["Aslak Hellesøy", "David Chelimsky", "James B. Byrne", "Mike Sassak"]
|
|
7
|
-
s.date = %q{2010-11-
|
|
7
|
+
s.date = %q{2010-11-09}
|
|
8
8
|
s.description = %q{Fork of Aruba, Cucumber steps for testing CLI applications.}
|
|
9
9
|
s.email = %q{cukes@googlegroups.com}
|
|
10
10
|
s.homepage = %q{http://github.com/byrnejb/aruba}
|
data/features/output.feature
CHANGED
|
@@ -76,6 +76,16 @@ Feature: Output
|
|
|
76
76
|
"""
|
|
77
77
|
hello
|
|
78
78
|
"""
|
|
79
|
+
|
|
80
|
+
@announce
|
|
81
|
+
Scenario: Match passing exit status and exact output
|
|
82
|
+
When I run "ruby -e 'puts \"hello\\nworld\"'"
|
|
83
|
+
Then it should pass with exactly:
|
|
84
|
+
"""
|
|
85
|
+
hello
|
|
86
|
+
world
|
|
87
|
+
|
|
88
|
+
"""
|
|
79
89
|
|
|
80
90
|
@announce-stdout
|
|
81
91
|
Scenario: Match failing exit status and partial output
|
data/features/std_out.feature
CHANGED
|
@@ -15,3 +15,21 @@ Feature: run command should not limit size of STDOUT
|
|
|
15
15
|
Then the stdout should contain "bbbbb"
|
|
16
16
|
When I run "ruby -e 'puts :c.to_s * 65537'"
|
|
17
17
|
Then the stdout should contain "ccccc"
|
|
18
|
+
|
|
19
|
+
@announce
|
|
20
|
+
Scenario: Check empty output
|
|
21
|
+
When I run "ruby -e 'r = 1 + 3'"
|
|
22
|
+
Then stdout should be empty
|
|
23
|
+
And stderr should be empty
|
|
24
|
+
|
|
25
|
+
@announce
|
|
26
|
+
Scenario: Check not empty output
|
|
27
|
+
When I run "ruby -e 'puts( %Q*Hello World!* )'"
|
|
28
|
+
Then stdout should not be empty
|
|
29
|
+
And stderr should be empty
|
|
30
|
+
|
|
31
|
+
@announce
|
|
32
|
+
Scenario: Check not empty error
|
|
33
|
+
When I run "ruby -e 'fail'"
|
|
34
|
+
Then stdout should be empty
|
|
35
|
+
And stderr should not be empty
|
data/lib/aruba/api.rb
CHANGED
|
@@ -81,11 +81,44 @@ module Aruba
|
|
|
81
81
|
end
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
-
#
|
|
85
|
-
#
|
|
84
|
+
# assert_exact_output compares the contents of the combined output
|
|
85
|
+
# for an exact match to the argument. See assert_partial_output.
|
|
86
|
+
# #
|
|
87
|
+
def assert_exact_output(exact_output)
|
|
88
|
+
combined_output.should == exact_output
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# assert_exit_status_and_output checks the contents of the combined output
|
|
92
|
+
# (exact) and also checks the exit status against the expected (zero or
|
|
93
|
+
# non-zero)
|
|
94
|
+
#
|
|
95
|
+
# Usage:
|
|
96
|
+
# Then /should (pass|fail) with exactly:$/ do |pass_fail, exact_output|
|
|
97
|
+
# assert_exit_status_and_output(pass_fail == "pass", exact_output, true)
|
|
98
|
+
#
|
|
99
|
+
def assert_exit_status_and_output(expect_to_pass, output, expect_exact_output)
|
|
100
|
+
if expect_exact_output
|
|
101
|
+
assert_exact_output(output)
|
|
102
|
+
else
|
|
103
|
+
assert_partial_output(output)
|
|
104
|
+
end
|
|
105
|
+
assert_exiting_with(expect_to_pass)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# assert_exit_status_and_partial_output checks the contents of the combined
|
|
110
|
+
# output (partial) and also checks the exit status against the expected
|
|
111
|
+
# (zero or non-zero)
|
|
86
112
|
#
|
|
87
113
|
def assert_exit_status_and_partial_output(expect_to_pass, partial_output)
|
|
88
114
|
assert_partial_output(partial_output)
|
|
115
|
+
assert_exiting_with(expect_to_pass)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# assert_exiting_with checks the exit status and fails if
|
|
119
|
+
# the expected condition is not met.
|
|
120
|
+
#
|
|
121
|
+
def assert_exiting_with(expect_to_pass)
|
|
89
122
|
if expect_to_pass
|
|
90
123
|
@last_exit_status.should == 0
|
|
91
124
|
else
|
data/lib/aruba/cucumber_steps.rb
CHANGED
|
@@ -309,7 +309,12 @@ end
|
|
|
309
309
|
|
|
310
310
|
|
|
311
311
|
When /should (pass|fail) with:$/ do |pass_fail, partial_output|
|
|
312
|
-
|
|
312
|
+
assert_exit_status_and_output(pass_fail == "pass", partial_output, false)
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
Then /should (pass|fail) with exactly:$/ do |pass_fail, exact_output|
|
|
317
|
+
assert_exit_status_and_output(pass_fail == "pass", exact_output, true)
|
|
313
318
|
end
|
|
314
319
|
|
|
315
320
|
|
|
@@ -334,12 +339,12 @@ end
|
|
|
334
339
|
|
|
335
340
|
|
|
336
341
|
When /stderr should not be empty$/ do
|
|
337
|
-
@last_stderr.
|
|
342
|
+
@last_stderr.should_not == ""
|
|
338
343
|
end
|
|
339
344
|
|
|
340
345
|
|
|
341
346
|
When /stdout should not be empty$/ do
|
|
342
|
-
@last_stdout.
|
|
347
|
+
@last_stdout.should_not == ""
|
|
343
348
|
end
|
|
344
349
|
|
|
345
350
|
|
|
@@ -353,6 +358,16 @@ When /stdout should contain "([^\"]*)"$/ do |partial_output|
|
|
|
353
358
|
end
|
|
354
359
|
|
|
355
360
|
|
|
361
|
+
Then /stderr should contain exactly:$/ do |exact_output|
|
|
362
|
+
@last_stderr.should == exact_output
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
Then /stdout should contain exactly:$/ do |exact_output|
|
|
367
|
+
@last_stdout.should == exact_output
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
|
|
356
371
|
When /stderr should not contain "([^\"]*)"$/ do |partial_output|
|
|
357
372
|
@last_stderr.should_not =~ regexp(partial_output)
|
|
358
373
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aruba-jbb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 93
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 2
|
|
9
9
|
- 6
|
|
10
|
-
-
|
|
11
|
-
version: 0.2.6.
|
|
10
|
+
- 13
|
|
11
|
+
version: 0.2.6.13
|
|
12
12
|
platform: ruby
|
|
13
13
|
authors:
|
|
14
14
|
- "Aslak Helles\xC3\xB8y"
|
|
@@ -19,7 +19,7 @@ autorequire:
|
|
|
19
19
|
bindir: bin
|
|
20
20
|
cert_chain: []
|
|
21
21
|
|
|
22
|
-
date: 2010-11-
|
|
22
|
+
date: 2010-11-09 00:00:00 -05:00
|
|
23
23
|
default_executable:
|
|
24
24
|
dependencies:
|
|
25
25
|
- !ruby/object:Gem::Dependency
|