aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-04 13:25:01 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-04 13:25:01 +0000
commit4fdebdbadf127911f07f8d71a934ef0e6a0c22f2 (patch)
treeda2d525cec0aec92ba77299a958b6f8e2abcfc04
parenta57a3895a56e585ae14d60839f655f320c79870a (diff)
downloadruby-4fdebdbadf127911f07f8d71a934ef0e6a0c22f2.tar.gz
Improve line covearge of ext/io/nonblock/nonblock.c from 54.5% to 95.5%
Not so good test, but it would be better than nothing, I guess... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/io/nonblock/nonblock.c2
-rw-r--r--test/io/nonblock/test_flush.rb18
2 files changed, 19 insertions, 1 deletions
diff --git a/ext/io/nonblock/nonblock.c b/ext/io/nonblock/nonblock.c
index 2509329f6c..1c0bdc68e7 100644
--- a/ext/io/nonblock/nonblock.c
+++ b/ext/io/nonblock/nonblock.c
@@ -1,6 +1,6 @@
/**********************************************************************
- io/wait.c -
+ io/nonblock.c -
$Author$
created at: Tue Jul 14 21:53:18 2009
diff --git a/test/io/nonblock/test_flush.rb b/test/io/nonblock/test_flush.rb
index bc60cab8bf..e014a5f3db 100644
--- a/test/io/nonblock/test_flush.rb
+++ b/test/io/nonblock/test_flush.rb
@@ -50,4 +50,22 @@ class TestIONonblock < Test::Unit::TestCase
assert_equal(4097, result.size)
true
end
+
+ def test_nonblock
+ IO.pipe {|r, w|
+ assert_equal(false, w.nonblock?)
+ w.nonblock do
+ assert_equal(true, w.nonblock?)
+ w.nonblock(false) do
+ assert_equal(false, w.nonblock?)
+ w.nonblock(false) do
+ assert_equal(false, w.nonblock?)
+ end
+ assert_equal(false, w.nonblock?)
+ end
+ assert_equal(true, w.nonblock?)
+ end
+ assert_equal(false, w.nonblock?)
+ }
+ end
end if IO.method_defined?(:nonblock)