Sha256: d6bb2fddee46f865aa5615f9f27dd484bd7366097430b9b8cbe074b11f2e8321
Contents?: true
Size: 610 Bytes
Versions: 52
Compression:
Stored size: 610 Bytes
Contents
require File.expand_path('../../../spec_helper', __FILE__) ruby_version_is "1.9" do describe "File#reopen" do before :each do @file = tmp('test.txt') @fh = nil touch(@file) { |f| f << "1234567890" } end after :each do @fh.close if @fh rm_r @file end it "resets the stream to a new file path" do @fh = File.new(@file) text = @fh.read @fh = @fh.reopen(@file, "r") @fh.read.should == text end it "accepts an object that has a #to_path method" do @fh = File.new(@file).reopen(mock_to_path(@file), "r") end end end
Version data entries
52 entries across 52 versions & 2 rubygems