Scope steps using RSpec metadata and tags
masterTo prevent step name conflicts, you can scope steps to specific tags. Turnip converts Gherkin tags (e.g., @interface) into RSpec metadata. You can then use RSpec's conditional include to only load certain modules when a specific tag is present.
module InterfaceSteps
step "I do it" do
...
end
end
module DatabaseSteps
step "I do it" do
...
end
end
RSpec.configure do |config|
config.include InterfaceSteps, :interface => true
config.include DatabaseSteps, :database => true
end@interface
Scenario: do it through the interface
@database
Scenario: do it through the databaseAlternatively, use the steps_for shortcut:
steps_for :interface do
step "I do it" do
...
end
end