From dd15e3c368f20e84206892efebc413d1cfd48843 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 18 Jan 2016 11:42:34 -0800 Subject: [PATCH] features: write EXIT STATUS to output so it all prints when we get an exit status we aren't expecting --- features/step_definitions.rb | 9 +++++++-- features/support/helpers.rb | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/features/step_definitions.rb b/features/step_definitions.rb index 64213ea4..d3695935 100644 --- a/features/step_definitions.rb +++ b/features/step_definitions.rb @@ -228,8 +228,13 @@ end # Then %r{^I should see "(.*)" in the build output$} do |text| - regexp = Regexp.new(text) - expect(jekyll_run_output).to match regexp + expect(jekyll_run_output).to match Regexp.new(text) +end + +# + +Then %r{^I should get a zero exit(?:\-| )status$} do + step %(I should see "EXIT STATUS: 0" in the build output) end # diff --git a/features/support/helpers.rb b/features/support/helpers.rb index 62892612..83010b9e 100644 --- a/features/support/helpers.rb +++ b/features/support/helpers.rb @@ -100,8 +100,13 @@ def run_in_shell(*args) end File.write(Paths.status_file, p.value.exitstatus) - File.write(Paths.output_file, out) if p.value.exitstatus == 0 - File.write(Paths.output_file, err) if p.value.exitstatus != 0 + File.open(Paths.output_file, "wb") do |f| + f.puts args.join(" ") + f.puts out + f.puts err + f.puts "EXIT STATUS: #{p.value.exitstatus}" + end + p.value end