1 require File.dirname(__FILE__) + '/../../spec_helper'
3 describe "File.atime" do
5 @file = tmp('test.txt')
6 File.open(@file, "w") {} # touch
10 File.delete(@file) if File.exist?(@file)
13 it "returns the last access time for the named file as a Time object" do
15 File.atime(@file).should be_kind_of(Time)
18 it "raises an Errno::ENOENT exception if the file is not found" do
19 lambda { File.atime('a_fake_file') }.should raise_error(Errno::ENOENT)
23 describe "File#atime" do
25 @name = File.expand_path(__FILE__)
26 @file = File.open(@name)
30 @file.close rescue nil
33 it "returns the last access time to self" do
35 @file.atime.should be_kind_of(Time)