Skip to content
Snippets Groups Projects
Unverified Commit 8e02df40 authored by Tom Robinson's avatar Tom Robinson Committed by GitHub
Browse files

update older-than test to not use hard coded date (#11642) (#11644)


* update older-than test to not use hard coded date

* update docstring to clarify that  compares times to now

* final fix for this bug

Co-authored-by: default avatarDaniel Higginbotham <daniel@flyingmachinestudios.com>
parent 075547e4
No related branches found
No related tags found
No related merge requests found
......@@ -379,8 +379,8 @@
ZonedDateTime (t/zoned-date-time))))
(defn older-than?
"True if temporal value `t` happened before some period/duration ago. Prefer this over using `t/before?`
because it is incredibly fussy about the classes of arguments it is passed.
"True if temporal value `t` happened before some period/duration ago, compared to now. Prefer this over using
`t/before?` to compare times to now because it is incredibly fussy about the classes of arguments it is passed.
;; did `t` happen more than 2 months ago?
(older-than? t (t/months 2))"
......
......@@ -381,7 +381,7 @@
(deftest older-than-test
(let [now (t/instant "2019-12-04T00:45:00Z")]
(t/with-clock (t/mock-clock (t/zone-id "America/Los_Angeles"))
(t/with-clock (t/mock-clock now (t/zone-id "America/Los_Angeles"))
(testing (str "now = " now)
(doseq [t ((juxt t/instant t/local-date t/local-date-time t/offset-date-time identity)
(t/zoned-date-time "2019-11-01T00:00-08:00[US/Pacific]"))]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment