ruby-changes:64593
From: Nobuyoshi <ko1@a...>
Date: Fri, 25 Dec 2020 16:01:51 +0900 (JST)
Subject: [ruby-changes:64593] caae14d90b (master): test_trick.rb: Make the encoding explicit for code written in UTF-8
https://git.ruby-lang.org/ruby.git/commit/?id=caae14d90b From caae14d90b3ae75f97913cd5420bd236a4eeb0f8 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 25 Dec 2020 15:57:41 +0900 Subject: test_trick.rb: Make the encoding explicit for code written in UTF-8 diff --git a/test/test_trick.rb b/test/test_trick.rb index c61a53f..43dc236 100644 --- a/test/test_trick.rb +++ b/test/test_trick.rb @@ -154,7 +154,7 @@ class TestTRICK2018 < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_trick.rb#L154 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 https://github.com/ruby/ruby/blob/trunk/test/test_trick.rb#L171 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. -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/