BDD Living Documentation with Yard-Cucumber

Yard Cucumber

Living documentation is very essential when working in the collaborative way with technology and business people. Behaviour Driven Development  [BDD]methodology enforces communication between business and technology. Any Documentation with nice web interface can be easily understood by the business people.

There are some tools like Relish(@relishapp) where you can host your living documentation but Yard-Cucumber is the nice and cool interface to host your living documentation locally.

The Yard-Cucumber is a RubyGem that creates documentation. The Yard-Cucumber is the cool and free solution to generate documentation locally. This plugin is developed by Frank Webber. Previously “Yard” can generate documentation with Class List, Method List and Tag List and README file but Yard-Cucumber add things like ‘Features’ and ‘Step-Definitions’.

Using Yard-Cucumber


I assume, you are using latest version of Ruby. Here is Ruby 2.0.0. In your existing Cucumber project, Just install Yard-Cucumber Gem. You may need ‘redcarpet’

Or in your Gemfile. Add the following Gems  you don’t have already


Now, install bundler with to use those Gems

Now you are good to use Yard-Cucumber.


Now, Let’s configure Yard Cucumber. Just run following commands from your project

Now, Let’s use inbuilt Rake Task to run Yard-Cucumber. If you don’t have rake then install it.

Let’s create a Rake task in the Rakefile

Now we have success fully configured Yard-Cucumber in our project.

Use Yard-Cucumber

Let’s use Yard-Cucumber with our rake task.

This will create a all documentation in the ‘/doc’ direcory. Now you will have .yarddoc and ‘doc’ directory in your project.

My iTerm window look like this:



How Documentation will Look Like?

This documentation contains list of all Features, Classes, Tags and Methods. It’s very handy to toggle between Features, Tags and Classes Or Methods.

It looks like this for example project:



Source-Code on GitHub

There is a example project available on my GitHub account. Cuke_Experiment 

You can Clone and Try it


Enjoy Living Documentation and Share it with your Team. !