From f66d8d24ee545c39edc4575291036414f3fe48b4 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Thu, 9 Apr 2015 22:01:45 +0000 Subject: [PATCH] Improve reporting in #uhwm_wait_output cucumber helper --- features/steps/output_steps.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/features/steps/output_steps.rb b/features/steps/output_steps.rb index 99ee4ed..558dd10 100644 --- a/features/steps/output_steps.rb +++ b/features/steps/output_steps.rb @@ -2,16 +2,17 @@ def uhwm_wait_output message, timeout: 1 Timeout.timeout(timeout) do loop do break if case message - when Regexp - @process.read_stdout =~ message - when String - assert_partial_output_interactive message + when Regexp then @process.read_stdout =~ message + when String then assert_partial_output_interactive message end sleep 0.1 end end rescue Timeout::Error - fail "expected message `#{message}' not seen after #{timeout} seconds" + fail [ + "expected `#{message}' not seen after #{timeout} seconds in:", + "```\n#{@process.stdout + @process.stderr}```" + ].join "\n" end Then /^the output must contain exactly the usage$/ do