Skip to content

Stubbed protocol method returns Clojure instant instead of Date #15

@eerohele

Description

@eerohele

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions