diff options
Diffstat (limited to 'spec/ruby/core/io/sysseek_spec.rb')
-rw-r--r-- | spec/ruby/core/io/sysseek_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/ruby/core/io/sysseek_spec.rb b/spec/ruby/core/io/sysseek_spec.rb index df894734e3..002f2a14eb 100644 --- a/spec/ruby/core/io/sysseek_spec.rb +++ b/spec/ruby/core/io/sysseek_spec.rb @@ -4,7 +4,7 @@ require_relative 'fixtures/classes' require_relative 'shared/pos' describe "IO#sysseek" do - it_behaves_like :io_set_pos, :seek + it_behaves_like :io_set_pos, :sysseek end describe "IO#sysseek" do @@ -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" |