Just realized if I call twice
#test.feature
When test abc cba
and test abc cba
#test_steps.rb
When(/^Test (.+)$/ do |arg|
puts arg
arg.remove! 'cba'
end
It will first return (puts
)
#=> abc cba
and in the second call
#=> abc
...interesting. To be sure I checked arg.object_id
in every call and its... the same
also checked same calls between difference scenarios and results didn't change at all.
My question is: How does cucumber saves same string between different When/Then calls ?