Skip to content

Commit

Permalink
Bit of refactor to let table dup itself.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaso committed Aug 19, 2012
1 parent b5d5796 commit 86a3af6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/turnip/builder.rb
Expand Up @@ -82,9 +82,9 @@ def to_scenarios(examples)
Scenario.new(@raw).tap do |scenario|
scenario.steps = steps.map do |step|
new_description = step.description.gsub(/<([^>]*)>/) { |_| Hash[headers.zip(row)][$1] }
new_extra_args = Marshal.load( Marshal.dump(step.extra_args) )
new_extra_args = step.extra_args.dup
if index = new_extra_args.find_index { |a| a.instance_of?(Turnip::Table) }
table = new_extra_args[index]
table = new_extra_args[index].dup
table.raw.each_index do |i|
table.raw[i].each_index do |j|
table.raw[i][j].gsub!(/<([^>]*)>/) { |_| Hash[headers.zip(row)][$1] }
Expand Down

0 comments on commit 86a3af6

Please sign in to comment.