factoring out timestamps helper method

This commit is contained in:
Donald Ball 2008-11-24 20:42:57 -06:00
parent 0ebc3a3d28
commit b9bd5edb17
1 changed files with 10 additions and 10 deletions

View File

@ -45,21 +45,21 @@ describe Zoomifier do
end end
it "should not recreate the tiles if the image date precedes them" do it "should not recreate the tiles if the image date precedes them" do
old_timestamps = timestamps(@output)
sleep(1)
Zoomifier::zoomify(@input)
new_timestamps = timestamps(@output)
old_timestamps.should == new_timestamps
end
def timestamps(dir)
timestamps = {} timestamps = {}
['/ImageProperties.xml', '/TileGroup0/*.jpg'].each do |pattern| ['/ImageProperties.xml', '/TileGroup0/*.jpg'].each do |pattern|
Dir.glob(@output + pattern) do |filename| Dir.glob(dir + pattern) do |filename|
timestamps[filename] = File.mtime(filename) timestamps[filename] = File.mtime(filename)
end end
end end
sleep(1) timestamps
Zoomifier::zoomify(@input)
new_timestamps = {}
['/ImageProperties.xml', '/TileGroup0/*.jpg'].each do |pattern|
Dir.glob(@output + pattern) do |filename|
new_timestamps[filename] = File.mtime(filename)
end
end
timestamps.should == new_timestamps
end end
end end