Skip to content

Instantly share code, notes, and snippets.

@fables-tales
Created September 24, 2012 10:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fables-tales/3775318 to your computer and use it in GitHub Desktop.
Save fables-tales/3775318 to your computer and use it in GitHub Desktop.
diff --git a/lib/rspec/core/example_group.rb b/lib/rspec/core/example_group.rb
index 6b167d0..56afa77 100644
--- a/lib/rspec/core/example_group.rb
+++ b/lib/rspec/core/example_group.rb
@@ -309,9 +309,12 @@ module RSpec
# @private
def self.run_before_all_hooks(example_group_instance)
return if descendant_filtered_examples.empty?
- assign_before_all_ivars(superclass.before_all_ivars, example_group_instance)
- run_hook(:before, :all, example_group_instance)
- store_before_all_ivars(example_group_instance)
+ begin
+ assign_before_all_ivars(superclass.before_all_ivars, example_group_instance)
+ run_hook(:before, :all, example_group_instance)
+ ensure
+ store_before_all_ivars(example_group_instance)
+ end
end
# @private
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment