Wrap text
Report abuse
|
|
it "should recognize when the file has not changed" do
puts "now: #{Time.now}"
faketime = (Time.now - Puppet[:filetimeout])
puts "faketime: #{faketime}"
File::Stat.stub!(:ctime).and_return(faketime) # normal rspec syntax
sleep(5)
puts "fake ctime: " + File.stat(@f.path).ctime.to_s
#sleep(Puppet[:filetimeout])
@loaded.changed?.should == false
end
Output:
now: Mon Apr 07 11:43:35 -0700 2008
faketime: Mon Apr 07 11:43:20 -0700 2008
fake ctime: Mon Apr 07 11:43:35 -0700 2008
|