Skip to content

Commit

Permalink
Check for read access in IO#getbyte spec
Browse files Browse the repository at this point in the history
  • Loading branch information
herwinw authored and eregon committed Sep 4, 2023
1 parent 091bc92 commit 7a65447
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions core/io/getbyte_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7a65447

Please sign in to comment.