Skip to content

Commit

Permalink
[core] choose encoded_description method content code earlier
Browse files Browse the repository at this point in the history
Instead of runtime
see https://github.com/rspec/rspec-core/pull/2575/files#r227002134

---
This commit was imported from rspec/rspec-core@8372e5c.
  • Loading branch information
benoittgt committed Nov 17, 2018
1 parent cc285cb commit e15b6eb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions rspec-core/lib/rspec/core/formatters/exception_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,13 @@ def formatted_message_and_backtrace(colorizer)
end
end

def encoded_description(description)
return if description.nil?

if String.method_defined?(:encoding)
if String.method_defined?(:encoding)
def encoded_description(description)
return if description.nil?
encoded_string(description)
else # for 1.8.7
end
else # for 1.8.7
def encoded_description(description)
description
end
end
Expand Down

0 comments on commit e15b6eb

Please sign in to comment.