spec/shared/read.rb in rubysl-stringio-2.0.0 vs spec/shared/read.rb in rubysl-stringio-2.1
- old
+ new
@@ -13,11 +13,11 @@
buffer.should == "example"
end
ruby_version_is "1.9" do
it "truncates buffer when limit is nil and no data reamins" do
- @io.send(@method)
+ @io.send(@method, nil)
@io.send(@method, nil, buffer = "abc").should == ""
buffer.should == ""
end
end
@@ -109,25 +109,25 @@
before(:each) do
@io = StringIO.new("example")
end
it "reads the whole content starting from the current position" do
- @io.send(@method).should == "example"
+ @io.send(@method, 10).should == "example"
@io.pos = 3
- @io.send(@method).should == "mple"
+ @io.send(@method, 10).should == "mple"
end
it "updates the current position" do
- @io.send(@method)
+ @io.send(@method, 10)
@io.pos.should eql(7)
end
ruby_bug "readmine#156", "1.8.7" do
it "returns an empty String when no data remains" do
- @io.send(@method).should == "example"
- @io.send(@method).should == ""
+ @io.send(@method, 7).should == "example"
+ @io.send(@method, nil).should == ""
end
end
with_feature :encoding do
it "returns a String in the same encoding as the source String" do
@@ -175,12 +175,12 @@
end
describe :stringio_read_not_readable, :shared => true do
it "raises an IOError" do
io = StringIO.new("test", "w")
- lambda { io.send(@method) }.should raise_error(IOError)
+ lambda { io.send(@method, 2) }.should raise_error(IOError)
io = StringIO.new("test")
io.close_read
- lambda { io.send(@method) }.should raise_error(IOError)
+ lambda { io.send(@method, 2) }.should raise_error(IOError)
end
end