Merge pull request #44703 from ghousemohamed/test-should-test-for-multibyte-char

Fixes test cases for ActiveSupport multibyte chars
This commit is contained in:
Rafael Mendonça França 2022-03-16 17:15:35 -04:00 committed by GitHub
commit 50ba8d4e30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -111,8 +111,9 @@ class MultibyteCharsUTF8BehaviourTest < ActiveSupport::TestCase
%w{capitalize downcase lstrip reverse rstrip swapcase upcase}.each do |method|
class_eval(<<-EOTESTS, __FILE__, __LINE__ + 1)
def test_#{method}_bang_should_return_self_when_modifying_wrapped_string
chars = ' él piDió Un bUen café '.dup
assert_equal chars.object_id, chars.public_send("#{method}!").object_id
original = ' él piDió Un bUen café '.dup
proxy = chars(original.dup)
assert_equal proxy.object_id, proxy.public_send("#{method}!").object_id
end
def test_#{method}_bang_should_change_wrapped_string