Allow a mix of with and table for model creation
-
TMaYaD
this might work haven't tested exhaustively
Given(/^the following #{capture_plural_factory} exists? with #{capture_fields} :?$/) do |plural_factory, fields, table| field_names = [] field_values = [] fields.split(/,/).each {|field| a = field.split /:/ field_names.append a[0].strip field_value.append a[1].strip } table_raw = table.raw table_raw[0] += field_names table_raw[1..table_raw.size].each {|row| row += field_values} Given "the following #{plural_factory} exists:", table(table_raw) end
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.