I am converting a cucumber table into hash so I’ve this:
The table look like this:
| parameter | value |
| param1 | abc |
| param2 | def,jkl,xyz |
and step definition looks like this:
When /^I set params to$/ do |table|
h = table.hashes
puts h[0]
puts h[0].values_at(“param1”)
Its printing the below values for the last two line
{“parameter”=>“param1”, “value”=>“abc”}
[nil]
why is it printing nil for second line?
what I want to do is call a method with the values in value column as a
separate array for each row. like this :
method (h[0].values_at(“param1”),h[1].values_at(“param2”))
my method looks like this:
def method ( a=[], b=[])
…
…
end
can someone pls help?