Sha256: 292b6e9af32356dad6a2509f78adf325301495afefbfab53ba26d6cf896c7a8f

Contents?: true

Size: 661 Bytes

Versions: 83

Compression:

Stored size: 661 Bytes

Contents

describe :io_pos, :shared => true do
  before :each do
    @fname = 'test.txt'
    File.open @fname, 'w' do |f| f.write "123" end
  end

  after :each do
    File.unlink @fname
  end

  it "gets the offset" do
    File.open @fname do |f|
      f.send(@method).should == 0
      f.read 1
      f.send(@method).should == 1
      f.read 2
      f.send(@method).should == 3
    end
  end

  it "raises IOError on closed stream" do
    lambda { IOSpecs.closed_file.send(@method) }.should raise_error(IOError)
  end

  it "resets #eof?" do
    open @fname do |io|
      io.read 1
      io.read 1
      io.send(@method)
      io.eof?.should == false
    end
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
rhodes-3.1.1 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.1.1.beta spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.1.0 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.1.0.beta.5 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.1.0.beta.4 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.1.0.beta.3 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.1.0.beta.2 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.1.0.beta.1 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.0.2 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.0.2.beta.1 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.0.1 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.0.1.beta.8 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.0.1.beta.7 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.0.1.beta.6 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.0.1.beta.5 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.0.1.beta.4 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.0.1.beta.3 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.0.1.beta.2 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.0.0 spec/framework_spec/app/spec/core/io/shared/pos.rb
rhodes-3.0.0.beta.7 spec/framework_spec/app/spec/core/io/shared/pos.rb