Permalink
Browse files

Merge pull request #13 from arbscht/relax-last-modified-time-test-for…

…-timezones

Relax expected timestamp test to a 48hr range for zipfile entries
  • Loading branch information...
2 parents 119725b + a7cff25 commit 9d070cc414066db4d4f037c4dd20b2273689d63d @magnars committed Feb 27, 2014
Showing with 8 additions and 1 deletion.
  1. +8 −1 test/optimus/assets_test.clj
@@ -28,11 +28,18 @@
"Missing files are not tolerated."
(load-assets public-dir ["/gone.js"]) => (throws FileNotFoundException "/gone.js")))
+(defn- plausible-timestamp? [actual-timestamp]
+ (let [upstream-timestamp 1384517932000
+ twenty-four-hours (* 24 3600 1000)]
+ (< (- upstream-timestamp twenty-four-hours)
+ actual-timestamp
+ (+ upstream-timestamp twenty-four-hours))))
+
(fact
"Files in JARs report the correct last-modified time."
(map (juxt :path :last-modified) (load-assets "optimus-test-jar" ["/blank.gif"]))
- => [["/blank.gif" 1384517932000]])
+ => (just (just ["/blank.gif" plausible-timestamp?])))
(with-files [["/styles/reset.css" ""]
["/styles/main.css" ""]

0 comments on commit 9d070cc

Please sign in to comment.