diff --git a/core/io/getbyte_spec.rb b/core/io/getbyte_spec.rb index 6ba8f0a3e..b4351160e 100644 --- a/core/io/getbyte_spec.rb +++ b/core/io/getbyte_spec.rb @@ -40,3 +40,19 @@ @io.getbyte.should == nil end end + +describe "IO#getbyte" do + before :each do + @name = tmp("io_getbyte.txt") + @io = new_io(@name, 'w') + end + + after :each do + @io.close if @io + rm_r @name if @name + end + + it "raises an IOError if the stream is not readable" do + -> { @io.getbyte }.should raise_error(IOError) + end +end