Skip to content

Commit

Permalink
fix: ensure diff is included in the json output
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Mar 21, 2020
1 parent f6a0b4d commit 0bd9753
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/pact/provider/rspec/json_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ def stop(notification)
output_hash[:examples] = notification.examples.map do |example|
format_example(example).tap do |hash|
e = example.exception
# No point providing a backtrace for a mismatch, too much noise
if e && ! e.is_a?(::RSpec::Expectations::ExpectationNotMetError)
if e
hash[:exception] = {
:class => e.class.name,
:message => e.message,
:backtrace => e.backtrace,
class: e.class.name,
message: e.message,
}
# No point providing a backtrace for a mismatch, too much noise
if !e.is_a?(::RSpec::Expectations::ExpectationNotMetError)
hash[:exception][:backtrace]
end
end
end
end
Expand Down

0 comments on commit 0bd9753

Please sign in to comment.