Try calling with-test-out :-
user> (use 'clojure.test)
*nil*
user> (deftest test1
(is (= "a" "b"))
(is (= "1" "1")))
*#'user/test1*
user> (with-test-out
(run-tests))
*Testing user
FAIL in (test1) (NO_SOURCE_FILE:1)
expected: (= "a" "b")
actual: (not (= "a" "b"))
Ran 1 tests containing 2 assertions.
1 failures, 0 errors.
{:type :summary, :pass 1, :test 1, :error 0, :fail 1}*
user> (run-tests)
*Testing user
FAIL in (test1) (NO_SOURCE_FILE:1)
expected: (= "a" "b")
actual: (not (= "a" "b"))
Ran 1 tests containing 2 assertions.
1 failures, 0 errors.
{:type :summary, :pass 1, :test 1, :error 0, :fail 1}*
Refer to this link:
http://richhickey.github.com/clojure/clojure.test-api.html
SAVING TEST OUTPUT TO A FILE
All the test reporting functions write to the var *test-out*. By
default, this is the same as *out*, but you can rebind it to any
PrintWriter. For example, it could be a file opened withclojure.java.io/writer.
Check with-test-out also.
Hope that helps.
Cheers.
On Mon, Aug 27, 2012 at 6:50 AM, Matthew Boston <[email protected]>wrote:
> Here's my output using the repl from leiningen 2 (nREPL)
>
> user=> (use 'clojure.test)
> nil
> user=> (is (= "a" "b"))
>
>
> FAIL in clojure.lang.PersistentList$EmptyList@1 (NO_SOURCE_FILE:1)
> expected: (= "a" "b")
> actual: (not (= "a" "b"))
> false
> user=>
>
> It tells me both the expected and actual. What else are you expecting?
>
> On Sunday, August 26, 2012 7:40:48 PM UTC-4, Erlis Vidal wrote:
>>
>> Hi guys,
>>
>> I'm starting to use clojure.test but when I got a failing test I don't
>> get any information why the error failed.
>>
>> for example if I evaluate this in the repl I just get *false* back
>>
>> (is (= "a" "b"))
>>
>> running the tests with (run-tests) give me this result back:
>>
>> {:type :summary, :pass 2, :test 1, :error 0, :fail 1}
>>
>> I would like to know if I'm missing something or maybe this is because
>> I'm using the lightable playground.
>>
>> Thanks,
>> Erlis
>>
> --
> 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
>
--
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