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

Commit e42f72b

Browse files
committed
Remove version-specific details from a doc
1 parent beef835 commit e42f72b

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

lib/rspec/support/encoded_string.rb

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,11 @@ def matching_encoding(string)
9595
# Originally defined as a constant to avoid uneeded allocations, this hash must
9696
# be defined inline (without {}) to avoid warnings on Ruby 2.7
9797
#
98-
# In MRI 2.1 'invalid: :replace' changed to also replace an invalid byte sequence
99-
# see https://github.com/ruby/ruby/blob/v2_1_0/NEWS#L176
100-
# https://www.ruby-forum.com/topic/6861247
101-
# https://twitter.com/nalsh/status/553413844685438976
98+
# 'invalid: :replace' also replaces an invalid byte sequence
10299
#
103-
# For example, given:
104-
# "\x80".force_encoding("Emacs-Mule").encode(:invalid => :replace).bytes.to_a
105-
#
106-
# On MRI 2.1 or above: 63 # '?'
107-
# else : 128 # "\x80"
100+
# For example:
101+
# "\x80".force_encoding("Emacs-Mule").encode(:invalid => :replace).bytes.to_a # =>
102+
# => 63 # '?'
108103
#
109104
string.encode(@encoding, :invalid => :replace, :undef => :replace, :replace => REPLACE)
110105
rescue Encoding::ConverterNotFoundError

0 commit comments

Comments
 (0)