diff options
Diffstat (limited to 'spec/ruby/core/io/ungetbyte_spec.rb')
-rw-r--r-- | spec/ruby/core/io/ungetbyte_spec.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/ruby/core/io/ungetbyte_spec.rb b/spec/ruby/core/io/ungetbyte_spec.rb index 1971dee534..9d189f8abb 100644 --- a/spec/ruby/core/io/ungetbyte_spec.rb +++ b/spec/ruby/core/io/ungetbyte_spec.rb @@ -66,6 +66,10 @@ describe "IO#ungetbyte" do end end + it "raises IOError on stream not opened for reading" do + -> { STDOUT.ungetbyte(42) }.should raise_error(IOError, "not opened for reading") + end + it "raises an IOError if the IO is closed" do @io.close -> { @io.ungetbyte(42) }.should raise_error(IOError) |