jnicklas/turnip — pull request #3 by leshill (2011-11-08 06:11:42+00:00)
Title: Load steps into modules

Hi Jonas,

The `steps_for` DSL extension inspired me to see what I could do to make the steps behave more like modules that are loaded into the Scenario examples.

These commits do a few things:

* multiple step files are supported, the files must match `**/*steps.rb` in the configured feature directory
* `steps_for` creates an anonymous module allowing better isolation of the step implementation code
* `uses_steps` added to DSL to allow one set of steps to pull in the steps from another step module (as well as any implementation code)
* normal use of the anonymous module is encouraged, for example including some extracted utility code into the module for use by the steps
* tags for Features are now added to any Scenario tags (parity with Cucumber)
* Background steps only use Feature tags

The external DSL is now just the `steps_for` statement. Each step file starts with a `steps_for` block, within that block the rest of the DSL is available. `step` declarations are now isolated, `placeholder` is still global in scope.

`steps_for :global` is given special status, any steps defined in that block are available to all Scenarios.

Take a look!