I am a newbie to Cucumber-Ruby. After defining the scenario, I executed the test in the terminal and cucumber suggested the snippet as follows :
Then("Show All button should be enabled") do
pending # Write code here that turns the phrase above into concrete actions
end
Then("Show All button should be disabled") do
pending # Write code here that turns the phrase above into concrete actions
end
I changed the code as below
Then("Show All button should be (enabled|disabled)") do |state|
puts(state)
end
But even after that when I execute the test using the terminal I receives the suggestion to add the snippet.
When I changed the code as below it worked
Then(/^Show All button should be (enabled|disabled)$/) do |state|
puts(state)
end
Can someone help me describing the difference between the codes?
USING
Ruby : ruby 2.3.3p222 Cucumber : 3.1.0