From 8bca9cf4c8b8f03012062373318bb0957b40d064 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Thu, 11 Dec 2014 12:03:10 -0800 Subject: [PATCH] Just encode --- test/test_execjs.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_execjs.rb b/test/test_execjs.rb index 804179e..2abb27c 100644 --- a/test/test_execjs.rb +++ b/test/test_execjs.rb @@ -101,8 +101,8 @@ class TestExecJS < Test "\\", "café", "☃", - "\u{1f604}".force_encoding("UTF-8"), # Smiling emoji - "\u{1f1fa}\u{1f1f8}".force_encoding("UTF-8"), # US flag + "\u{1f604}".encode("UTF-8"), # Smiling emoji + "\u{1f1fa}\u{1f1f8}".encode("UTF-8"), # US flag [1, 2, 3], [1, [2, 3]], [1, [2, [3]]], @@ -168,7 +168,7 @@ class TestExecJS < Test assert_equal str, ExecJS.eval("'#{str}'") # US flag emoji - str = "\u{1f1fa}\u{1f1f8}".force_encoding("UTF-8") + str = "\u{1f1fa}\u{1f1f8}".encode("UTF-8") assert_equal 4, ExecJS.eval("'#{str}'.length") assert_equal str, ExecJS.eval("'#{str}'") end