Reputation: 3651
In a process of making Gherkin a little more readable, I'm trying to call a step within a step.
Given /^I am a user with a case with (.*) properties with X enabled$/ do |number|
if number == 2
step "I login as a, 1, 2 user with X num_of_properties_2"
puts "prop2"
elsif number == 1
step "I login as a, 1, 2 user with X num_of_properties_1"
puts "prop1"
end
end
Neither of these will work, however if I do only
Given /^I am a user with a case with (.*) properties with X enabled$/ do |number|
step "I login as a, 1, 2 user with X num_of_properties_2"
end
This works perfectly.
Any reason why I cannot call another step within an "if" statement?
Upvotes: 0
Views: 1086