Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax expected timestamp test to a 48hr range for zipfile entries #13

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion test/optimus/assets_test.clj
Expand Up @@ -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" ""]
Expand Down