No description
Find a file
2014-03-27 12:03:04 -04:00
src/pjstadig Add activation function to enable the humane output. 2014-03-27 12:01:15 -04:00
test/pjstadig Add activation function to enable the humane output. 2014-03-27 12:01:15 -04:00
.dir-locals.el Initial commit. 2014-03-26 17:54:35 -04:00
.gitignore Ignore .asc files. 2014-03-26 21:13:33 -04:00
project.clj Bump version to 0.5.0. 2014-03-27 12:03:04 -04:00
README.org Bump version to 0.5.0. 2014-03-27 12:03:04 -04:00

Humane test output for clojure.test

This library does two things:

  1. Test output is pretty printed.
  2. Equality assertions are also diffed.

To use this library, include it in your dev profile:

[pjstadig/humane-test-output "0.5.0"]

To activate it you will need to call pjstadig.humane-test-output/activate!. One way to do this would be to put this in a user.clj file in your test classpath.

Once it is activated, instead of this:

FAIL in (a-test) (humane_test_output_test.clj:7)
FIXME, I fail.
expected: (= {:foo :bar, :baz :quux, :something "a long string?", :another-key "and another value"} {:fo :bar, :baz :quux, :something "a long string?", :another-key "and another value"})
  actual: (not (= {:another-key "and another value", :foo :bar, :something "a long string?", :baz :quux} {:another-key "and another value", :something "a long string?", :fo :bar, :baz :quux}))

FAIL in (a-test) (humane_test_output_test.clj:11)
FIXME, I fail.
expected: (= {:foo :bar, :baz :quux} {:foo :bar, :baz :quux} {:fo :bar, :baz :quux})
  actual: (not (= {:foo :bar, :baz :quux} {:foo :bar, :baz :quux} {:fo :bar, :baz :quux}))

FAIL in (a-test) (humane_test_output_test.clj:14)
FIXME, I fail.
expected: (list? foo)
  actual: (not (list? {:another-key "and another value", :foo :bar, :something "a long string?", :baz :quux}))

You get this:

FAIL in (a-test) (humane_test_output_test.clj:7)
FIXME, I fail.
expected: {:another-key "and another value",
           :foo :bar,
           :something "a long string?",
           :baz :quux}
  actual: {:fo :bar}
    diff: - {:baz :quux,
             :something "a long string?",
             :foo :bar,
             :another-key "and another value"}
          + {:fo :bar}

FAIL in (a-test) (humane_test_output_test.clj:10)
FIXME, I fail.
expected: {:foo :bar, :baz :quux}
  actual: {:fo :bar, :baz :quux}
    diff: - {:foo :bar}
          + {:fo :bar}

FAIL in (a-test) (humane_test_output_test.clj:13)
FIXME, I fail.
expected: (list? foo)
  actual: (not
           (list?
            {:another-key "and another value",
             :foo :bar,
             :something "a long string?",
             :baz :quux}))

License

Copyright © Paul Stadig, Bryce Covert, Outpace, Inc.. All rights reserved.

Some small bits of code were taken from clojure.test and modified, and are
Copyright © Rich Hickey.  All rights reserved.

Distributed under the Eclipse Public License, the same as Clojure.