summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-08-01 21:07:08 -0500
committerSamuel Giddins <segiddins@segiddins.me>2016-08-03 09:24:00 -0500
commit1056356adf7b870196e99dfab6b8c16789d07290 (patch)
tree8e2f21b2ccf6f52516f2d519648a28d110078628
parent29fb4282ea198b2c62d2a580d8ab1ba1fb54de3b (diff)
downloadbundler-1056356adf7b870196e99dfab6b8c16789d07290.tar.gz
Ensure all output is printed at the end of failure/error message too
-rw-r--r--spec/spec_helper.rb8
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)