Methods
- #
- S
- T
-
- test_ascii_strings_are_treated_at_utf8_strings,
- test_concatenate_should_return_proxy_instance,
- test_concatenation_should_return_a_proxy_class_instance,
- test_consumes_utf8_strings,
- test_forwarded_bang_method_calls_should_return_nil_when_result_is_nil,
- test_forwarded_bang_method_calls_should_return_the_original_chars_instance_when_result_is_not_nil,
- test_forwarded_method_calls_should_return_new_chars_instance,
- test_forwarded_method_with_non_string_result_should_be_returned_vertabim,
- test_methods_are_forwarded_to_wrapped_string_for_byte_strings,
- test_should_allow_method_calls_to_string,
- test_should_concatenate,
- test_should_return_string_as_json,
- test_wraps_the_original_string
Included Modules
Instance Public methods
__method_for_multibyte_testing()
Link
__method_for_multibyte_testing!()
Link
__method_for_multibyte_testing_that_returns_nil!()
Link
__method_for_multibyte_testing_with_integer_result()
Link
setup()
Link
test_ascii_strings_are_treated_at_utf8_strings()
Link
test_concatenate_should_return_proxy_instance()
Link
# File activesupport/test/multibyte_chars_test.rb, line 88 def test_concatenate_should_return_proxy_instance assert(('a'.mb_chars + 'b').kind_of?(@proxy_class)) assert(('a'.mb_chars + 'b'.mb_chars).kind_of?(@proxy_class)) assert(('a'.mb_chars << 'b').kind_of?(@proxy_class)) assert(('a'.mb_chars << 'b'.mb_chars).kind_of?(@proxy_class)) end
test_concatenation_should_return_a_proxy_class_instance()
Link
# File activesupport/test/multibyte_chars_test.rb, line 79 def test_concatenation_should_return_a_proxy_class_instance assert_equal ActiveSupport::Multibyte.proxy_class, ('a'.mb_chars + 'b').class assert_equal ActiveSupport::Multibyte.proxy_class, ('a'.mb_chars << 'b').class end
test_consumes_utf8_strings()
Link
test_forwarded_bang_method_calls_should_return_nil_when_result_is_nil()
Link
# File activesupport/test/multibyte_chars_test.rb, line 43 def test_forwarded_bang_method_calls_should_return_nil_when_result_is_nil @chars.wrapped_string.singleton_class.class_eval { def __method_for_multibyte_testing_that_returns_nil!; end } assert_nil @chars.__method_for_multibyte_testing_that_returns_nil! end
test_forwarded_bang_method_calls_should_return_the_original_chars_instance_when_result_is_not_nil()
Link
# File activesupport/test/multibyte_chars_test.rb, line 36 def test_forwarded_bang_method_calls_should_return_the_original_chars_instance_when_result_is_not_nil @chars.wrapped_string.singleton_class.class_eval { def __method_for_multibyte_testing!; 'result'; end } assert_kind_of @proxy_class, @chars.__method_for_multibyte_testing! assert_equal @chars.object_id, @chars.__method_for_multibyte_testing!.object_id end
test_forwarded_method_calls_should_return_new_chars_instance()
Link
# File activesupport/test/multibyte_chars_test.rb, line 29 def test_forwarded_method_calls_should_return_new_chars_instance @chars.wrapped_string.singleton_class.class_eval { def __method_for_multibyte_testing; 'result'; end } assert_kind_of @proxy_class, @chars.__method_for_multibyte_testing assert_not_equal @chars.object_id, @chars.__method_for_multibyte_testing.object_id end
test_forwarded_method_with_non_string_result_should_be_returned_vertabim()
Link
# File activesupport/test/multibyte_chars_test.rb, line 53 def test_forwarded_method_with_non_string_result_should_be_returned_vertabim str = '' str.singleton_class.class_eval { def __method_for_multibyte_testing_with_integer_result; 1; end } @chars.wrapped_string.singleton_class.class_eval { def __method_for_multibyte_testing_with_integer_result; 1; end } assert_equal str.__method_for_multibyte_testing_with_integer_result, @chars.__method_for_multibyte_testing_with_integer_result end
test_methods_are_forwarded_to_wrapped_string_for_byte_strings()
Link
test_should_allow_method_calls_to_string()
Link
# File activesupport/test/multibyte_chars_test.rb, line 18 def test_should_allow_method_calls_to_string @chars.wrapped_string.singleton_class.class_eval { def __method_for_multibyte_testing; 'result'; end } assert_nothing_raised do @chars.__method_for_multibyte_testing end assert_raise NoMethodError do @chars.__unknown_method end end
test_should_concatenate()
Link
# File activesupport/test/multibyte_chars_test.rb, line 61 def test_should_concatenate mb_a = 'a'.mb_chars mb_b = 'b'.mb_chars assert_equal 'ab', mb_a + 'b' assert_equal 'ab', 'a' + mb_b assert_equal 'ab', mb_a + mb_b assert_equal 'ab', mb_a << 'b' assert_equal 'ab', 'a' << mb_b assert_equal 'abb', mb_a << mb_b end
test_should_return_string_as_json()
Link