Sha256: 1c5142dbaf817863ca9b43c30d04154a7d1846843072fefaa4eeefd55e40f4a2

Contents?: true

Size: 716 Bytes

Versions: 3

Compression:

Stored size: 716 Bytes

Contents

describe :tempfile_length, :shared => true do
  before :each do
    @tempfile = Tempfile.new("specs")
  end

  after :each do
    TempfileSpecs.cleanup @tempfile
  end

  it "returns the size of self" do
    @tempfile.send(@method).should eql(0)
    @tempfile.print("Test!")
    @tempfile.send(@method).should eql(5)
  end

  ruby_version_is ''...'1.9.2' do
    it "returns 0 when self is closed" do
      @tempfile.print("Test!")
      @tempfile.close
      @tempfile.send(@method).should eql(0)
    end
  end

  ruby_version_is '1.9.2' do
    it "returns the size of self even if self is closed" do
      @tempfile.print("Test!")
      @tempfile.close
      @tempfile.send(@method).should eql(5)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubysl-tempfile-2.0.1 spec/shared/length.rb
rubysl-tempfile-1.0.0 spec/shared/length.rb
rubysl-tempfile-2.0.0 spec/shared/length.rb