shrubbery icon indicating copy to clipboard operation
shrubbery copied to clipboard

Stubbed protocol method returns Clojure instant instead of Date

Open eerohele opened this issue 6 years ago • 1 comments

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?

eerohele avatar Jul 06 '18 10:07 eerohele

Actually, is this what the Caveats section of the README refers to?

eerohele avatar Jul 06 '18 10:07 eerohele