summaryrefslogtreecommitdiff
path: root/spec/ruby/core/io/ungetc_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/io/ungetc_spec.rb')
-rw-r--r--spec/ruby/core/io/ungetc_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/ruby/core/io/ungetc_spec.rb b/spec/ruby/core/io/ungetc_spec.rb
index 85c15b5a71..dc31c3743a 100644
--- a/spec/ruby/core/io/ungetc_spec.rb
+++ b/spec/ruby/core/io/ungetc_spec.rb
@@ -136,6 +136,10 @@ describe "IO#ungetc" do
@io.ungetc(100).should be_nil
end
+ it "raises IOError on stream not opened for reading" do
+ -> { STDOUT.ungetc(100) }.should raise_error(IOError, "not opened for reading")
+ end
+
it "raises IOError on closed stream" do
@io.getc
@io.close