diff options
| author | Tomoyuki Sahara <[email protected]> | 2014-04-18 11:20:55 +0900 |
|---|---|---|
| committer | Tomoyuki Sahara <[email protected]> | 2014-04-18 11:20:55 +0900 |
| commit | 36045ea96fa499681a5773c1148a7ddc6715face (patch) | |
| tree | ba496c26fa79eb4636afec0d94fb85a63cbaf5a2 /test | |
| parent | 1c4f46f3244bf4b4b3e8acf55348e6104a2ace4f (diff) | |
| download | mruby-36045ea96fa499681a5773c1148a7ddc6715face.tar.gz mruby-36045ea96fa499681a5773c1148a7ddc6715face.zip | |
IO#syswrite should raise an error if it's not opened for writing.
Diffstat (limited to 'test')
| -rw-r--r-- | test/io.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/io.rb b/test/io.rb index 0db0e9e75..eb605ef31 100644 --- a/test/io.rb +++ b/test/io.rb @@ -92,7 +92,12 @@ assert('IO.sysopen, IO#syswrite') do len = io.syswrite(str) assert_equal str.size, len io.close - io.closed? + + io = IO.new(IO.sysopen($mrbtest_io_rfname), "r") + assert_raise(IOError) { io.syswrite("a") } + io.close + + true end assert('IO#_read_buf') do |
