diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-08-01 21:07:08 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-08-03 09:24:00 -0500 |
commit | 1056356adf7b870196e99dfab6b8c16789d07290 (patch) | |
tree | 8e2f21b2ccf6f52516f2d519648a28d110078628 | |
parent | 29fb4282ea198b2c62d2a580d8ab1ba1fb54de3b (diff) | |
download | bundler-1056356adf7b870196e99dfab6b8c16789d07290.tar.gz |
Ensure all output is printed at the end of failure/error message too
-rw-r--r-- | spec/spec_helper.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c9158e693e..074645ec50 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -102,7 +102,13 @@ RSpec.configure do |config| config.after :each do |example| @all_output.strip! - warn @all_output if example.exception && !@all_output.empty? + if example.exception && !@all_output.empty? + warn @all_output + message = example.exception.message + "\n\nCommands:\n#{@all_output}" + (class << example.exception; self; end).send(:define_method, :message) do + message + end + end Dir.chdir(original_wd) ENV.replace(original_env) |