Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 8372e5c

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 0c9f05f commit 8372e5c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/rspec/core/formatters/exception_presenter.rb

+6-5
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)