Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Emacs minor mode for expectations test framework
Emacs Lisp
Latest commit 4869529 @gar3thjon3s Merge pull request #9 from duelinmarkers/cider-0.8.2
Deal with cider 0.8.2 rename fun.

Expectations Mode

A minor Emacs mode for running Expectations, based upon Clojure test mode.


Versions 0.0.2 and lower use swank, version 0.0.3 and greater use nrepl. Going forward, I will only be supporting the nrepl code.


Please note Expectations v1.3.7 or greater is required to use expectations-mode.

You can either install the package manually or use the package manager package.el.

To install using the package manager, add the marmalade repo to your package-archives:

(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "") t)

And package-install expectations-mode in the usual way.

To install manually, download expectations-mode.el, put it somewhere on your Emacs load path, and require it inside of init.el

(require 'expectations-mode)

This will add a clojure-mode-hook to enable expectations-mode whenever a Clojure test file is opened that has a namespace with 'expectations.' or '-expectations' inside of it.

For example namespaces like...

(ns myproject.expectations.core
  (:use expectations))

(ns myproject.core-expectations
  (:use expectations))

...will cause expectations-mode to automatically activate. Where as namespaces like:

(ns myproject.test.core
  (:use clojure.test))

...will be ignored.


Expectations colourises its output by default. To turn this off and get rid of the annoying characters in your output, add this to your init.el in an appropriate place:

(setenv "EXPECTATIONS_COLORIZE" "false")


Current key mappings are:

C-c ,    run tests in ns
C-c C-,  run tests in ns
C-c k    clear test results
C-c '    show message for test under cursor

The keybindings are a subset of the bindings used in clojure-test-mode and work the same way.

The shortcuts to run individual tests are not required, as you generally use the -focus version of the expectations macros to run an expectation in isolation.


Distributed under the GNU General Public License; see C-h t to view.

Something went wrong with that request. Please try again.