about summary refs log tree commit homepage
path: root/test/test_process.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_process.rb')
-rw-r--r--test/test_process.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/test_process.rb b/test/test_process.rb
index ad2b641..7f7b014 100644
--- a/test/test_process.rb
+++ b/test/test_process.rb
@@ -1,4 +1,3 @@
-# -*- encoding: binary -*-
 # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
 require './test/helper'
@@ -6,6 +5,13 @@ require 'dtas/process'
 class TestProcess < Minitest::Unit::TestCase
   include DTAS::Process
 
+  def test_encoding
+    assert_equal Encoding::BINARY, qx('echo HIHIH').encoding
+    s = ""
+    a = qx('echo HIHIHI; echo >&2 BYEBYE', err_str: s)
+    assert_equal Encoding::BINARY, a.encoding
+  end
+
   def test_qx_env
     assert_equal "WORLD\n", qx({"HELLO" => "WORLD"}, 'echo $HELLO')
   end