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

Version Path
rhodes-3.2.2 spec/framework_spec/app/spec/library/stringio/lineno_spec.rb
rhodes-3.2.2.beta spec/framework_spec/app/spec/library/stringio/lineno_spec.rb
rhodes-3.2.1 spec/framework_spec/app/spec/library/stringio/lineno_spec.rb
rhodes-3.2.0 spec/framework_spec/app/spec/library/stringio/lineno_spec.rb
rhodes-3.2.0.beta.9 spec/framework_spec/app/spec/library/stringio/lineno_spec.rb
rhodes-3.2.0.beta.8 spec/framework_spec/app/spec/library/stringio/lineno_spec.rb
rhodes-3.2.0.beta.7 spec/framework_spec/app/spec/library/stringio/lineno_spec.rb
rhodes-3.2.0.beta.6 spec/framework_spec/app/spec/library/stringio/lineno_spec.rb
rhodes-3.2.0.beta.5 spec/framework_spec/app/spec/library/stringio/lineno_spec.rb
rhodes-3.2.0.beta.4 spec/framework_spec/app/spec/library/stringio/lineno_spec.rb
rhodes-3.2.0.beta.2 spec/framework_spec/app/spec/library/stringio/lineno_spec.rb
rhodes-3.2.0.beta.1 spec/framework_spec/app/spec/library/stringio/lineno_spec.rb