Skip to content

Commit 05526ea

Browse files
committed
choose encoded_description method content code earlier
Instead of runtime see https://github.com/rspec/rspec-core/pull/2575/files#r227002134
1 parent 7af5cbb commit 05526ea

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/rspec/core/formatters/exception_presenter.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,13 @@ def formatted_message_and_backtrace(colorizer)
244244
end
245245
end
246246

247-
def encoded_description(description)
248-
return if description.nil?
249-
250-
if String.method_defined?(:encoding)
247+
if String.method_defined?(:encoding)
248+
def encoded_description(description)
249+
return if description.nil?
251250
encoded_string(description)
252-
else # for 1.8.7
251+
end
252+
else # for 1.8.7
253+
def encoded_description(description)
253254
description
254255
end
255256
end

0 commit comments

Comments
 (0)