Skip to content

Commit

Permalink
Better dup that array before pusing on it!
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Jun 29, 2010
1 parent 1bd1ed0 commit c26fefe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rspec/core/example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def wrapped_example
end

def around_hooks(example_group_class, example_group_instance, &wrapped_example)
hooks = RSpec.configuration.hooks[:around][:each]
hooks = RSpec.configuration.hooks[:around][:each].dup
hooks.push example_group_class.ancestors.reverse.map{|a| a.hooks[:around][:each]}
hooks.flatten.reverse.inject(wrapped_example) do |wrapper, hook|
def wrapper.run; call; end
Expand Down

0 comments on commit c26fefe

Please sign in to comment.