Skip to content

p-lambert/mutant.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 

Repository files navigation

mutant.el

An interface for the Mutant testing tool


MELPA

This package provides an interface for dealing with the Mutant testing tool, enabling one to easily launch it from a .rb file or even from a dired buffer. The generated output is nicely formatted and provides direct links to the errors reported by the mutations. I've tried to mimic the rspec-mode overall experience as much as possible.

Installation

This package can be installed via MELPA, or manually by downloading mutant.el and adding it to your init file, as it follows:

(add-to-list 'load-path "/path/to/mutant")
(require 'mutant)

For having mutant-mode enabled automatically, I suggest you to do the following:

(add-hook 'ruby-mode-hook 'mutant-mode)

Usage

By default, the following keybindings will be available:

  • C-c . f runs mutant-check-file
  • C-c . c runs mutant-check-custom

For dired mode integration, just add the following to your configuration file:

(add-hook 'dired-mode-hook 'mutant-dired-mode)

By doing so, you'll be able to mark files and then press C-c . f for running mutant on them.

See the Function Documentation for more details.

Customization

If you're a rvm user, you might have to add the following to your configuration file:

(add-hook 'mutant-precompile-hook
          (lambda () (rvm-activate-corresponding-ruby)))

Notice that this obviously requires rvm.el to be installed.

In order to execute the mutant command with a bundle exec prefix, simply add the following to your configuration file:

(setq mutant-cmd-base "bundle exec mutant")

Changelog

1.0 - First release.

Function Documentation

(mutant-check-file &optional FILE-NAME)

Run Mutant over a single file. If none is given, then buffer-file-name is used.

(mutant-check-from-dired)

Run Mutant over all marked files in dired. If there are no files marked, use that under cursor.

(mutant-check-custom &optional MATCH-EXP)

Run Mutant over MATCH-EXP. When called without argument, prompt user.


Markdown README file generated by make-readme-markdown.el

About

An Emacs interface for Mutant

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published