Hi,

I'm playing with Stuart Sierra's lazytest[1]. I'm trying to get access
at the test results of a test. I defined a spec and when I evaluate
it, it looks like I get a TestResults back. Trying to assign this to a
var fails with a java.lang.AbstractMethodError:

Clojure=> (spec my-spec
            (is
              (= 2 (* 2 1))
              (= 4 (* 2 2))))
#:SimpleContainer{:children [#:SimpleContainer{:children
[#:SimpleAssertion{:pred #<core_test$eval__4382$fn__4383
bound_variable.core_test$eval__4382$fn__4...@7099e017>}
#:SimpleAssertion{:pred #<core_test$eval__4382$fn__4385
bound_variable.core_test$eval__4382$fn__4...@2faadcc6>}]}]}
Clojure=> (my-spec)
#:TestResults{:source #:SimpleContainer{:children
[#:SimpleContainer{:children [#:SimpleAssertion{:pred
#<core_test$eval__4382$fn__4383
bound_variable.core_test$eval__4382$fn__4...@7099e017>}#:SimpleAssertion{:pred
#<core_test$eval__4382$fn__4385
bound_variable.core_test$eval__4382$fn__4...@2faadcc6>}]}]}, :children
(#:TestResults{:source #:SimpleContainer{:children
[#:SimpleAssertion{:pred #<core_test$eval__4382$fn__4383
bound_variable.core_test$eval__4382$fn__4...@7099e017>}
#:SimpleAssertion{:pred #<core_test$eval__4382$fn__4385
bound_variable.core_test$eval__4382$fn__4...@2faadcc6>}]}, :children
(#:TestPassed{:source #:SimpleAssertion{:pred
#<core_test$eval__4382$fn__4383
bound_variable.core_test$eval__4382$fn__4...@7099e017>}, :states nil}
#:TestPassed{:source #:SimpleAssertion{:pred
#<core_test$eval__4382$fn__4385
bound_variable.core_test$eval__4382$fn__4...@2faadcc6>}, :states
nil})})}
Clojure=> (def my-result (my-spec))
#<CompilerException java.lang.AbstractMethodError (REPL:28)>

I don't understand this error. What's going on? What is this #:
notation I'm seeing? Is that related to deftype?

I thought it might be something to do with laziness, so I tried the following:

Clojure=> (def my-result (doto (my-spec)))
#'bound-variable.core-test/my-result

Which works. Now my-result contains what I wanted. Is this what doto is for?

Thanks,
Mike

[1] http://github.com/stuartsierra/lazytest

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to