[前][次][番号順一覧][スレッド一覧]

ruby-changes:61160

From: Nobuyoshi <ko1@a...>
Date: Sat, 9 May 2020 14:01:51 +0900 (JST)
Subject: [ruby-changes:61160] cc9bc14530 (master): [ruby/io-console] Added test for failed path

https://git.ruby-lang.org/ruby.git/commit/?id=cc9bc14530

From cc9bc145300d129f27ad3a4ce186d7b1e3068b88 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 9 May 2020 13:55:48 +0900
Subject: [ruby/io-console] Added test for failed path

https://github.com/ruby/io-console/commit/06a540f9b4

diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb
index a02605d..eb0bb22 100644
--- a/test/io/console/test_io_console.rb
+++ b/test/io/console/test_io_console.rb
@@ -29,6 +29,16 @@ class TestIO_Console < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L29
   def set_winsize_teardown
     trap(:TTOU, @old_ttou) if defined?(@old_ttou) and @old_ttou
   end
+
+  def test_failed_path
+    skip unless Errno.const_defined?(:ENODEV)
+    File.open(IO::NULL) do |f|
+      e = assert_raise(Errno::ENODEV) do
+        f.echo?
+      end
+      assert_include(e.message, IO::NULL)
+    end
+  end
 end
 
 defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]