Skip to content

What's new in midje 1.6

marick edited this page Apr 28, 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")
  • 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)
Clone this wiki locally