Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 3 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Showing with 16 additions and 9 deletions.
  1. +1 −1 Gemfile.lock
  2. +4 −0 History.md
  3. +1 −1 aruba.gemspec
  4. +10 −7 lib/aruba/api.rb
View
2 Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- aruba (0.4.4)
+ aruba (0.4.5)
bcat (>= 0.6.1)
childprocess (>= 0.1.9)
cucumber (>= 0.10.7)
View
4 History.md
@@ -1,3 +1,7 @@
+## [v0.4.5](https://github.com/cucumber/aruba/compare/v0.4.4...v0.4.5)
+
+* Better assertion failure message when an exit code is not as expected
+
## [v0.4.4](https://github.com/cucumber/aruba/compare/v0.4.3...v0.4.4)
* Fix various bugs with interative processes. (Matt Wynne)
View
2 aruba.gemspec
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = 'aruba'
- s.version = '0.4.4'
+ s.version = '0.4.5'
s.authors = ["Aslak Hellesøy", "David Chelimsky", "Mike Sassak", "Matt Wynne"]
s.description = 'CLI Steps for Cucumber, hand-crafted for you in Aruba'
s.summary = "aruba-#{s.version}"
View
17 lib/aruba/api.rb
@@ -185,11 +185,17 @@ def assert_success(success)
end
def assert_exit_status(status)
- last_exit_status.should == status
+ last_exit_status.should eq(status),
+ append_output_to("Exit status was #{last_exit_status} but expected it to be #{status}.")
end
def assert_not_exit_status(status)
- last_exit_status.should_not == status
+ last_exit_status.should_not eq(status),
+ append_output_to("Exit status was #{last_exit_status} which was not expected.")
+ end
+
+ def append_output_to(message)
+ "#{message} Output:\n\n#{all_output}\n"
end
def processes
@@ -248,11 +254,8 @@ def run_simple(cmd, fail_on_error=true)
run(cmd) do |process|
stop_process(process)
end
- @timed_out = @last_exit_status.nil?
-
- if(@last_exit_status != 0 && fail_on_error)
- fail("Exit status was #{@last_exit_status}. Output:\n#{all_output}")
- end
+ @timed_out = last_exit_status.nil?
+ assert_exit_status(0) if fail_on_error
end
def run_interactive(cmd)

No commit comments for this range

Something went wrong with that request. Please try again.