Skip to content

Commit

Permalink
names
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Jun 18, 2011
1 parent 5ed585d commit c240059
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/rspec/core/example.rb
Expand Up @@ -110,7 +110,7 @@ def with_around_hooks(&block)
if around_hooks.empty?
yield
else
@example_group_class.eval_around_eachs(self, Example.procsy(metadata, &block)).call
@example_group_class.run_around_each_hooks(self, Example.procsy(metadata, &block)).call
end
end

Expand Down Expand Up @@ -146,11 +146,11 @@ def record_finished(status, results={})

def run_before_each
@example_group_instance.setup_mocks_for_rspec if @example_group_instance.respond_to?(:setup_mocks_for_rspec)
@example_group_class.eval_before_eachs(self)
@example_group_class.run_before_each_hooks(self)
end

def run_after_each
@example_group_class.eval_after_eachs(self)
@example_group_class.run_after_each_hooks(self)
@example_group_instance.verify_mocks_for_rspec if @example_group_instance.respond_to?(:verify_mocks_for_rspec)
ensure
@example_group_instance.teardown_mocks_for_rspec if @example_group_instance.respond_to?(:teardown_mocks_for_rspec)
Expand Down
14 changes: 7 additions & 7 deletions lib/rspec/core/example_group.rb
Expand Up @@ -200,33 +200,33 @@ def self.assign_before_all_ivars(ivars, example_group_instance)
ivars.each { |ivar, val| example_group_instance.instance_variable_set(ivar, val) }
end

def self.eval_before_alls(example_group_instance)
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)
world.run_hook_filtered(:before, :all, self, example_group_instance)
run_hook!(:before, :all, example_group_instance)
store_before_all_ivars(example_group_instance)
end

def self.eval_around_eachs(example, initial_procsy)
def self.run_around_each_hooks(example, initial_procsy)
example.around_hooks.reverse.inject(initial_procsy) do |procsy, around_hook|
Example.procsy(procsy.metadata) do
example.example_group_instance.instance_eval_with_args(procsy, &around_hook)
end
end
end

def self.eval_before_eachs(example)
def self.run_before_each_hooks(example)
world.run_hook_filtered(:before, :each, self, example.example_group_instance, example)
ancestors.reverse.each { |ancestor| ancestor.run_hook(:before, :each, example.example_group_instance) }
end

def self.eval_after_eachs(example)
def self.run_after_each_hooks(example)
ancestors.each { |ancestor| ancestor.run_hook(:after, :each, example.example_group_instance) }
world.run_hook_filtered(:after, :each, self, example.example_group_instance, example)
end

def self.eval_after_alls(example_group_instance)
def self.run_after_all_hooks(example_group_instance)
return if descendant_filtered_examples.empty?
assign_before_all_ivars(before_all_ivars, example_group_instance)

Expand Down Expand Up @@ -258,14 +258,14 @@ def self.run(reporter)
reporter.example_group_started(self)

begin
eval_before_alls(new)
run_before_all_hooks(new)
result_for_this_group = run_examples(reporter)
results_for_descendants = children.map {|child| child.run(reporter)}.all?
result_for_this_group && results_for_descendants
rescue Exception => ex
fail_filtered_examples(ex, reporter)
ensure
eval_after_alls(new)
run_after_all_hooks(new)
before_all_ivars.clear
reporter.example_group_finished(self)
end
Expand Down

0 comments on commit c240059

Please sign in to comment.