Fork me on GitHub

Gitnesse

Gitnesse is an acceptance testing tool.

It enables a project to store Cucumber feature stories in a git-based wiki, test them against your code, and then update the wiki with the latest test results.

The advantage is, that the features are on a wiki, so non-programmers can see them, and edit using the wiki. Hence an awesome bi-directional testing flow between developers and non-developers on a team.

Conceptually influenced by Fitnesse, thank you Uncle Bob!.

Screenshots

Feature in Github Wiki, with last test result annotated
Pulling features from Github wiki to local project.

Installation

Add this line to your applications's Gemfile:

gem 'gitnesse'
And then execute:
$ bundle
Or install it yourself as
$ gem install gitnesse
Create a gitnesse.rb file somewhere in your project, and add configuration like this:
Gitnesse.configure do |config|
  config.repository_url =  "git@github.com:hybridgroup/gitnesse-wiki.wiki"
  config.annotate_results = "true"
  config.info = "Bob Martin's Work Laptop"
end

Git Config

Gitnesse depends on two values being present in your gitconfig: user.name and user.email. These will be used when annotating test results, and to identify commits you make to the feature wiki. If Gitnesse complains that you don't have these set, you can fix this by entering the following lines in your terminal:

$ git config --add --global user.name <your_name>
$ git config --add --global user.email <your_email>

Rake tasks

$ rake -T
rake gitnesse:info         # Dump the current config info to the console.
rake gitnesse:pull         # Pull features from remote git wiki repository.
rake gitnesse:push         # Push features to remote git wiki repository.
rake gitnesse:run          # Pull features from remote repository and run cucumber.
rake gitnesse:push_results # Push features to remote repository and run cucumber, pushing results to wiki.

Usage in Rails 3

For Rails 3 the rake tasks should automatically just appear, as long as you have added the gitnesse gem to your Gemfile.

There is an example application using Rails 3 located here: https://github.com/hybridgroup/gitnesse-example-rails

Usage in Sinatra

To use gitnesse in a Sinatra application, simple add this line of code to your Rakefile:

require "gitnesse/tasks"

There is an example application using Sinatra located here: https://github.com/hybridgroup/gitnesse-example-sinatra

Other usage

Want to use plain old Gitnesse? There is an executable, if you're allergic to rake tasks:

$ gitnesse

More Info

You can find out more about Gitnesse on GitHub.