Permalink
Browse files

Bit of refactor to let table dup itself.

  • Loading branch information...
1 parent b5d5796 commit 86a3af63696e7377745cc0e821a3a7c8400b635c @lukaso lukaso committed Aug 19, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/turnip/builder.rb
View
@@ -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] }

0 comments on commit 86a3af6

Please sign in to comment.