Emacs mode for editing Cucumber plain text stories
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
features relative feature path when using docker-compose Sep 7, 2017
snippets/feature-mode
support
.gitignore have git ignore temporary files created from running bdd tests Nov 23, 2016
CHANGELOG.md Use bundle exec to run cucumber when Gemfile exists Nov 23, 2016
CONTRIBUTORS Avoid disabling electric-indent-mode globally Nov 14, 2014
Dockerfile Added Docker environment Sep 7, 2017
Gemfile Define feature files for indentation and customization and enable an … Nov 22, 2016
Gemfile.lock
Makefile Define feature files for indentation and customization and enable an … Nov 22, 2016
README.md
docker-compose.yml Added Docker environment Sep 7, 2017
feature-mode-pkg.el Bump version to 0.5.0-dev Nov 21, 2014
feature-mode.el relative feature path when using docker-compose Sep 7, 2017
i18n.yml

README.md

cucumber.el

Emacs mode for editing plain text user stories

Installation

Manual

Copy all the files to ~/.emacs.d/elisp/feature-mode, for example, and add this to your .emacs to load the mode

(add-to-list 'load-path "~/.emacs.d/elisp/feature-mode")

Package.el

feature-mode is available in both Marmalade and MELPA.

You can install it with the following command:

M-x package-install feature-mode

Optional configurations

Set default language if .feature doesn't have "# language: fi"

(setq feature-default-language "fi")

Point to cucumber languages.yml or gherkin i18n.yml to use exactly the same localization your cucumber uses

(setq feature-default-i18n-file "/path/to/gherkin/gem/i18n.yml")

Load feature-mode

(require 'feature-mode)
(add-to-list 'auto-mode-alist '("\.feature$" . feature-mode))

Point goto-step-definition capability to your step definitions

(setq feature-step-search-path "features/**/*steps.rb")
(setq feature-step-search-gems-path "gems/ruby/*/gems/*/**/*steps.rb")

The feature-step-search-gems-path variable points to where you have extra gems installed that have extra step definitions. For example, if you use bundler to install gems for your project and put them in a gems/ directory via:

bundle install --path ./gems

Key Bindings

In order to get goto-step-definition to work, you must install the ruby_parser gem (version 2.0.x) and gherkin (version 2.11.8). For example:

gem install ruby_parser --version "~> 2.0.5"
gem install gherkin --version 2.11.8
Keybinding Description
C-c ,v Verify all scenarios in the current buffer file.
C-c ,s Verify the scenario under the point in the current buffer.
C-c ,f Verify all features in project. (Available in feature and ruby files)
C-c ,r Repeat the last verification process.
C-c ,g Go to step-definition under point (requires ruby_parser gem >= 2.0.5)

Supported languages

At the moment, Cucumber.el supports whatever your Cucumber supports. Just configure it to load i18n.yml from your Gherkin gem sources.

Support for docker-compose

If the project path contains a docker-compose.yml file, Cucumber is executed through docker-compose.

The following variables can be set to change the behavior related too this:

Variable Type Description
feature-use-docker-compose boolean Use docker-compose when available
feature-docker-compose-command string The docker-compose command to execute
feature-docker-compose-container string Name of the container to start Cucumber in

Project Development / Maintenance

To run the tests in the source project, do the following:

gem install bundler
bundle
make test

You may have to use sudo to run the gem install command.

LICENSE

Copyright (C) 2008 — 2016 Michael Klishin and other contributors

You can redistribute it and/or modify it under the terms of the GNU General Public License either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110.