Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a couple basic IO#readbyte specs (1.9)

  • Loading branch information...
commit 467655887b84b1a5f15b501d4c365efc017c0408 1 parent 27107ef
@headius headius authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 core/io/readbyte_spec.rb
View
21 core/io/readbyte_spec.rb
@@ -2,6 +2,27 @@
ruby_version_is "1.9" do
describe "IO#readbyte" do
+ before :each do
+ @io = File.open(__FILE__, 'r')
+ end
+
+ after :each do
+ @io.close
+ end
+
+ it "reads one byte from the stream" do
+ byte = @io.readbyte
+ byte.should == ?r.getbyte(0)
+ @io.pos.should == 1
+ end
+
+ it "raises EOFError on EOF" do
+ @io.seek(999999)
+ lambda do
+ @io.readbyte
+ end.should raise_error EOFError
+ end
+
it "needs to be reviewed for spec completeness"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.