diff options
author | Nobuyoshi Nakada <[email protected]> | 2020-12-25 15:57:41 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2020-12-25 15:57:41 +0900 |
commit | caae14d90b3ae75f97913cd5420bd236a4eeb0f8 (patch) | |
tree | 712c627053e9b17f5d2ac896ed70d53b12c5ed05 | |
parent | 67fe290bb3e812487e400457feae83574295508b (diff) |
test_trick.rb: Make the encoding explicit for code written in UTF-8
-rw-r--r-- | test/test_trick.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_trick.rb b/test/test_trick.rb index c61a53f7b6..43dc2364da 100644 --- a/test/test_trick.rb +++ b/test/test_trick.rb @@ -154,7 +154,7 @@ class TestTRICK2018 < Test::Unit::TestCase def test_04_colin src = File.join(__dir__, "../sample/trick2018/04-colin/entry.rb") - code = "# encoding: UTF-8\n" + File.read(src) + <<END + code = "# encoding: UTF-8\n" + File.read(src, encoding: "UTF-8") + <<END \u{1F914} "Math" do \u{1F914} "Addition" do \u{1F914} "One plus one equals two.", @@ -171,7 +171,7 @@ class TestTRICK2018 < Test::Unit::TestCase end end END - assert_in_out_err(["-W0"], code, <<END.lines(chomp: true)) + assert_in_out_err(["-W0"], code, <<END.lines(chomp: true), encoding: "UTF-8") Math Addition One plus one equals two. |