Sunday, September 27, 2015

Buttercup 1.2 released

I just released version 1.2 of Buttercup, the Behavior-Driven Emacs Lisp Testing framework.

Buttercup is a behavior-driven development framework for testing Emacs Lisp code. It is heavily inspired by Jasmine.

Installation and Use

Buttercup is available from MELPA Stable.

Example test suite:

(describe "A suite"
  (it "contains a spec with an expectation"
    (expect t :to-be t)))

Suites group tests, and suites can be nested. Contrary to ERT, suites can share set-up and tear-down code for tests, and Buttercup comes with built-in support for mocks in the form of spies. See the package homepage above for a full description of the syntax for test suites and specs.

Buttercup comes with a shell script to run the default discover runner. If used together with cask, cask exec buttercup will find, load and run test suites in your project.

Changes Since 1.1

  • The :to-have-been-called-with matcher now shows the actual call arguments in addition to the expected ones to make it easier to figure out what went wrong.
  • Interactive test calls now show the end of the output buffer to make it easier to see results, and do not change the selected window in case of errors anymore.
  • Test discovery now does not accidentally load non-Lisp files anymore, and excludes dotfiles more reliably.

Many thanks to Matus Goljer for testing and bugfixes!