shrubbery
shrubbery copied to clipboard
Stubbed protocol method returns Clojure instant instead of Date
I'm a bit confused by this:
$ clj -Srepro -Sdeps '{:deps {com.gearswithingears/shrubbery {:mvn/version "0.4.1"}}}'
user=> (use 'shrubbery.core)
nil
user=> (defprotocol A (x [this]))
A
user=> (def fake-A (stub A {:x (java.util.Date.)}))
#'user/fake-A
user=> (x fake-A)
#inst "2018-07-06T10:44:01.025-00:00"
Why does (x fake-A)
return a Clojure instant instead of the original java.util.Date
object? Is there any way around it other than using reify
directly to create the stub?
Actually, is this what the Caveats section of the README refers to?