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

Stubbed protocol method returns Clojure instant instead of Date #15

Open
eerohele opened this issue Jul 6, 2018 · 1 comment
Open

Comments

@eerohele
Copy link

eerohele commented Jul 6, 2018

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
Copy link
Author

eerohele commented Jul 6, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant