Provide Cucumber users the ability to create locally scoped step definitions and methods such that they are only usable from within one feature. In the style of Spinach.
Feature: cool kid
Given I am a cool kid
When I do cool things
Then I am a cooler kid
Steps:
cool_kid_steps.rb
Cucumber::Features::CoolKid < Cucumber::FeatureSteps
step 'I am a cool kid'
pending 'i am a cool kid'
end
step 'I do cool things'
pending 'I do cool things'
end
step 'I am a cooler kid'
pending 'I am a cooler kid'
end
When this feature is ran via cucumber cucumber features/cool_kid.feature an error is throw:
undefined method `pending' for #<Cucumber::Features::CoolKid:0x007fd66dfc8668> (NoMethodError)
./features/step_definitions/cool_kid_steps.rb:14:in `block in <class:CoolKid>'
For example, CoolKid.feature
Steps: cool_kid_steps.rb
When this feature is ran via cucumber
cucumber features/cool_kid.feature
an error is throw: