When /I (un)?check the following items: (.*)/ do |uncheck, items_list|
items_list.split(/,\s?/).each do |item|
step %Q{I #{uncheck}check "items_#{item.gsub! /"/, ''}"}
end
end
I have a check and uncheck step defined in another file that works great
if in my feature I call
When I check the following items: "A,B,C"
it works
if I call
When I uncheck the following items: "D,E,F"
it happens that cucumber tryes to uncheck ‘items_’ <<– ??? why this doesn’t contain D, E or F???
Try to remove the bang “!” from:
Use:
Or better: