Skip to content

What's new in midje 1.6

Brian Marick edited this page Jul 29, 2013 · 19 revisions

Midje 1.6 is currently being developed. See the main page for the most recent version number.

  • autotest can take file arguments (Joseph Wilk)

    The :dirs option is deprecated, replaced by :files or :file. The arguments can be files or directories.

    (autotest :file "test/midje/t_repl.clj")
    (autotest :files "test/midje/t_repl.clj" "src/midje")
  • JUnix/XML style output (Joseph Wilk)

    By putting:

    (change-defaults :emitter 'midje.emission.plugins.junit 
                     :print-level :print-facts 
                     :colorize false)

    in a config file, you get the style of XML output traditionally associated with JUnit. It's supported by various continuous integration servers.

    Output doesn't go to the screen. It's put in a report.xml file in the root of your project.

  • TAP output (Giorgio Valoti)

    By putting:

    (change-defaults :emitter 'midje.emission.plugins.tap 
                     :print-level :print-facts 
                     :colorize false)

    in a config file, you get TAP-format output. In contrast to the JUnit format, output goes to standard out. (Which is better?)

  • a progress-meter style of reporting (Joseph Wilk)

    By setting the :emitter config option to 'midje.emission.plugins.progress, you get "dot style" output:

    .........FFFF.FFFF.FFF..FP...................
    

    Periods mean success, "F" means failure, and "P" represents a future fact.

    After the tests are run, the normal failure messages and summary are printed.

  • Optional arguments in prerequisites (Joseph Wilk)

    If you don't care about arguments at the end of the argument list, you can do this:

    (fact 
        (find-letter) => ..letter-result..
        (provided
          (letter "x" & anything) => ..letter-result..))

    The value after the & is compared to the remaining arguments using extended equality. Therefore, you can do this:

    (fact
      (find-letter) => ..letter-result..
      (provided
        (letter & (contains ["x" "y"])) => ..letter-result..))
  • Setting colorize via .midje.clj config (Joseph Wilk)

    You can turn off color used in the terminal output by setting "colorize" in your .midje.clj config. You can also still use the ENV variable MIDJE_COLORIZE=false or MIDJE_COLORIZE=true. The environment always takes precedent.

    (change-defaults :colorize false)
    (change-defaults :colorize reverse)
  • Colorizing works in nrepl (Colin Jones)

  • Autotest works in nrepl (Colin Jones)

  • A variety of improvements around error reporting and autotest

Clone this wiki locally