Sha256: 599fe6c497853eb1146a1c7f1c59c7ceabf6c9c412f5dfbfe5f225ba520da2a8
Contents?: true
Size: 627 Bytes
Versions: 52
Compression:
Stored size: 627 Bytes
Contents
require File.expand_path('../../../spec_helper', __FILE__) require "stringio" describe "StringIO#lineno" do before(:each) do @io = StringIO.new("this\nis\nan\nexample") end it "returns the number of lines read" do @io.gets @io.gets @io.gets @io.lineno.should eql(3) end end describe "StringIO#lineno=" do before(:each) do @io = StringIO.new("this\nis\nan\nexample") end it "sets the current line number, but has no impact on the position" do @io.lineno = 3 @io.pos.should eql(0) @io.gets.should == "this\n" @io.lineno.should eql(4) @io.pos.should eql(5) end end
Version data entries
52 entries across 52 versions & 2 rubygems