Permalink
Browse files

Relax expected timestamp test to a 48hr range for zipfile entries due…

… to timezones
  • Loading branch information...
1 parent 119725b commit a7cff250ea86cf3874112cfdc72391d8e1e109db @arbscht arbscht 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 a7cff25

Please sign in to comment.