paulelliott/fabrication — pull request #72 by bdmac (2011-11-18 07:40:12+00:00)
Title: Turnip generator

Adds a generator for fabrication steps in Turnip. Pretty much copies the existing cucumber generator wholesale.

The generator supports a single flag for overriding the Turnip step directory.

I had to make a minor, temporary, change to `Fabrication::Cucumber::StepFabricator#from_table` to accomodate Turnip. Turnip does not currently support rows_hash (vertical tables) so I added a respond_to? check to fall back on just table.hashes (horizontal tables). I already have the change for Turnip ready to go to add rows_hash to its table object so this can be nuked once that's pulled into master. Maybe we leave it in so the contract on the passed in table is weaker (only requires #hashes is defined but will work with #rows_hash if available)?

At this point Fabrication::Cucumber::StepFabricator is actually probably not a very accurate name since it really seems like it supports any framework using Gherkin (Cucumber, Turnip, Spinach, etc) but I did not rename it.