features: write EXIT STATUS to output so it all prints when we get an exit status we aren't expecting

This commit is contained in:
Parker Moore 2016-01-18 11:42:34 -08:00
parent 7d81c00b29
commit dd15e3c368
2 changed files with 14 additions and 4 deletions

View File

@ -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
#

View File

@ -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