cucumber-step_writer/README.md

38 lines
880 B
Markdown
Raw Normal View History

2012-04-18 19:34:06 +00:00
Formatter for automatically generating step files for Cucumber. It's how I roll.
If you have a step like this:
``` gherkin
Given I set something up
```
And you set up the formatter like this:
```
cucumber -f Cucumber::StepWriter --out features/step_definitions
```
2012-04-18 19:37:48 +00:00
Then `features/step_definitions/given/i_set_something_up.rb` will be generated with
the content of the step stub.
2012-04-18 19:34:06 +00:00
2012-04-18 19:36:37 +00:00
If you want to fire an action after steps are generated, like open a directory with
the list of files so you can rearrange them, add a hook to Cucumber::StepWriter:
``` ruby
Cucumber::StepWriter.after_write do |dir|
system %{open #{dir}}
end
```
Set up your sane defaults by using the generator:
``` bash
rails generator cucumber:step_writer
```
2012-04-18 19:34:06 +00:00
TODO:
* If you want it to generate for different languages, I take pull requests.
* Otherwise, I'll just add whatever I need when I need it.