Skip to content
This repository was archived by the owner on Nov 16, 2018. It is now read-only.
jaigouk edited this page Aug 13, 2010 · 29 revisions

Install
-—————————————

Cucumber can be used with Merb via the merb_cucumber plugin.

To install merb_cucumber:

sudo gem install david-merb_cucumber

Or you can install "jsmestad-merb_cucumber ":http://github.com/jsmestad/merb_cucumber

sudo gem install jsmestad-merb_cucumber

Here is a brief note from jsmestad.

Note – you must uninstall david-merb_cucumber in order for this gem to take precedence. Merb + Cucumber + Webrat testing stack. Builds upon David’s work, but binds Webrat as a dependency to hopefully ensure a smooth upgrade for future Webrat releases. Also Factory_Girl generators will be added soon.

Usage
-—————————————

Then inside of a merb application directory, try:

merb-gen cucumber

merb-gen feature FEATURE_NAME

edit your feature

describe can use multiple given blocks

For example, you can now
write

<pre>

given “some food” do
@food = “pizza”
end

given “some drink” do
@drink = “beer”
end

describe “Something”, :given => [“some food”, “some drink”] do
it “should have dinner” do

  1. has @food and @drink set to pizza and beer, respectively
    end
    end

rake features

Looking for Examples?
-—————————————

So am I. Therefore I’ve been scrounging github in search of some. There are many merb projects out there with empty /features sitting around so searching github can potentially return many false positives.

But, please add some when you find them!

Here are some merb projects that use cucumber (feel free to add/update/delete this list accordingly, I did not rigorously weed through each one but I did only include /features that had actual substantial or interesting/creative examples):

Tutorials
-—————————————

Clone this wiki locally