aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/multibyte_test_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/multibyte_test_helpers.rb')
-rw-r--r--activesupport/test/multibyte_test_helpers.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activesupport/test/multibyte_test_helpers.rb b/activesupport/test/multibyte_test_helpers.rb
index 597f949059..8839b75601 100644
--- a/activesupport/test/multibyte_test_helpers.rb
+++ b/activesupport/test/multibyte_test_helpers.rb
@@ -4,6 +4,9 @@ module MultibyteTestHelpers
UNICODE_STRING = 'こにちわ'
ASCII_STRING = 'ohayo'
BYTE_STRING = "\270\236\010\210\245"
+ if BYTE_STRING.respond_to?(:force_encoding)
+ BYTE_STRING.force_encoding("ASCII-8BIT")
+ end
def chars(str)
ActiveSupport::Multibyte::Chars.new(str)
@@ -16,4 +19,4 @@ module MultibyteTestHelpers
def assert_equal_codepoints(expected, actual, message=nil)
assert_equal(inspect_codepoints(expected), inspect_codepoints(actual), message)
end
-end \ No newline at end of file
+end