Sha256: b33a457e1453e30d13b6095f37b38819bab5b89003451cbb5e55f3e280d8d9df
Contents?: true
Size: 812 Bytes
Versions: 52
Compression:
Stored size: 812 Bytes
Contents
require File.expand_path('../../../spec_helper', __FILE__) describe "File.mtime" do before :each do @filename = tmp('i_exist') touch(@filename) { @mtime = Time.now } end after :each do rm_r @filename end it "returns the modification Time of the file" do File.mtime(@filename).should be_kind_of(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 @f.close rm_r @filename end it "returns the modification Time of the file" do @f.mtime.should be_kind_of(Time) end end
Version data entries
52 entries across 52 versions & 2 rubygems