Skip to content

Commit

Permalink
Merge pull request #1201 from herwinw/stringio_sysread
Browse files Browse the repository at this point in the history
Specs for StringIO#sysread and StringIO#read_nonblock
  • Loading branch information
andrykonchin authored Oct 14, 2024
2 parents 41c5991 + d738189 commit 13c747b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/stringio/shared/sysread.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

it "raises an EOFError when passed length > 0 and no data remains" do
@io.read.should == "example"
-> { @io.sysread(1) }.should raise_error(EOFError)
-> { @io.send(@method, 1) }.should raise_error(EOFError)
end
end
5 changes: 5 additions & 0 deletions library/stringio/sysread_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require_relative '../../spec_helper'
require "stringio"
require_relative 'shared/read'
require_relative 'shared/sysread'

describe "StringIO#sysread when passed length, buffer" do
it_behaves_like :stringio_read, :sysread
Expand Down Expand Up @@ -32,6 +33,10 @@
end
end

describe "StringIO#sysread when passed length" do
it_behaves_like :stringio_sysread_length, :sysread
end

describe "StringIO#sysread when passed [length]" do
before :each do
@io = StringIO.new("example")
Expand Down

0 comments on commit 13c747b

Please sign in to comment.