Class: TestMobilyUnicodeConverter
- Inherits:
-
MiniTest::Unit::TestCase
- Object
- MiniTest::Unit::TestCase
- TestMobilyUnicodeConverter
- Defined in:
- lib/mobily/test/tc_convert_to_mobily_unicode.rb
Instance Method Summary collapse
- #test_arabic_string_from_api_docs ⇒ Object
- #test_multi_byte_characters ⇒ Object
- #test_single_byte_characters ⇒ Object
Instance Method Details
#test_arabic_string_from_api_docs ⇒ Object
9 10 11 12 |
# File 'lib/mobily/test/tc_convert_to_mobily_unicode.rb', line 9 def test_arabic_string_from_api_docs exp = '06270647064406270020064806330647064406270020062806430020064506390020006D006F00620069006C0079002E00770073' assert_equal exp, MobilyApiUnicodeConverter.convert('اهلا وسهلا بك مع mobily.ws') end |
#test_multi_byte_characters ⇒ Object
19 20 21 22 |
# File 'lib/mobily/test/tc_convert_to_mobily_unicode.rb', line 19 def test_multi_byte_characters assert_equal '2022', MobilyApiUnicodeConverter.convert('•') assert_equal '03C0', MobilyApiUnicodeConverter.convert('π') end |
#test_single_byte_characters ⇒ Object
14 15 16 17 |
# File 'lib/mobily/test/tc_convert_to_mobily_unicode.rb', line 14 def test_single_byte_characters assert_equal '000D', MobilyApiUnicodeConverter.convert("\r") assert_equal '004D', MobilyApiUnicodeConverter.convert('M') end |