Skip to content

clojure-expectations/expectations-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expectations Mode

Circle CI

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

Important

Versions 0.0.2 and lower use swank, version 0.0.3 and greater use nrepl. Going forward, only nrepl will be supported.

Installation

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" . "http://marmalade-repo.org/packages/") 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.

Colours

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")

Usage

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.

License

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

About

Emacs minor mode for expectations test framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published