Sha256: 5b293304c5cf6810a7413861a2ecc7acb6e7a1d193b718cbdcd5a25703cabefc
Contents?: true
Size: 898 Bytes
Versions: 83
Compression:
Stored size: 898 Bytes
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' describe "File.mtime" do before :each do @filename = tmp('i_exist') File.open(@filename, 'w') { @mtime = Time.now } end after :each do File.delete(@filename) if File.exist?(@filename) end it "returns the modification Time of the file" do File.mtime(@filename).class.should == Time File.mtime(@filename).should be_close(@mtime, 2.0) end it "raises an Errno::ENOENT exception if the file is not found" do lambda { File.mtime('bogus') }.should raise_error(Errno::ENOENT) end end describe "File#mtime" do before :each do @filename = tmp('i_exist') @f = File.open(@filename, 'w') end after :each do File.delete(@filename) if File.exist?(@filename) end it "returns the modification Time of the file" do @f.mtime.class.should == Time end end
Version data entries
83 entries across 83 versions & 1 rubygems