summaryrefslogtreecommitdiff
path: root/spec/ruby/core/io/sysseek_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/io/sysseek_spec.rb')
-rw-r--r--spec/ruby/core/io/sysseek_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/ruby/core/io/sysseek_spec.rb b/spec/ruby/core/io/sysseek_spec.rb
index df894734e3..e631939bce 100644
--- a/spec/ruby/core/io/sysseek_spec.rb
+++ b/spec/ruby/core/io/sysseek_spec.rb
@@ -26,6 +26,11 @@ describe "IO#sysseek" do
-> { @io.sysseek(-5, IO::SEEK_CUR) }.should raise_error(IOError)
end
+ it "seeks normally even when called immediately after a buffered IO#read" do
+ @io.read(15)
+ @io.sysseek(-5, IO::SEEK_CUR).should == 10
+ end
+
it "moves the read position relative to the start with SEEK_SET" do
@io.sysseek(43, IO::SEEK_SET)
@io.readline.should == "Aquí está la línea tres.\n"