Skip to content
Browse files

it's descendant, silly

  • Loading branch information...
1 parent 8df9054 commit fa42f5b76aca09f5afd874829a5cd58cf25b8e77 @dchelimsky dchelimsky committed Jun 13, 2010
Showing with 12 additions and 12 deletions.
  1. +8 −8 lib/rspec/core/example_group.rb
  2. +1 −1 lib/rspec/core/world.rb
  3. +3 −3 spec/rspec/core/example_group_spec.rb
View
16 lib/rspec/core/example_group.rb
@@ -72,8 +72,8 @@ def self.filtered_examples
world.filtered_examples[self]
end
- def self.descendent_filtered_examples
- filtered_examples + children.collect{|c| c.descendent_filtered_examples}
+ def self.descendant_filtered_examples
+ filtered_examples + children.collect{|c| c.descendant_filtered_examples}
end
def self.metadata
@@ -115,8 +115,8 @@ def self.children
@children ||= []
end
- def self.descendents
- [self] + children.collect {|c| c.descendents}.flatten
+ def self.descendants
+ [self] + children.collect {|c| c.descendants}.flatten
end
def self.ancestors
@@ -136,7 +136,7 @@ def self.before_all_ivars
end
def self.eval_before_alls(running_example)
- return if descendent_filtered_examples.empty?
+ return if descendant_filtered_examples.empty?
superclass.before_all_ivars.each { |ivar, val| running_example.instance_variable_set(ivar, val) }
world.run_hook(:before, :all, self, running_example)
@@ -157,7 +157,7 @@ def self.eval_after_eachs(running_example)
end
def self.eval_after_alls(running_example)
- return if descendent_filtered_examples.empty?
+ return if descendant_filtered_examples.empty?
before_all_ivars.each { |ivar, val| running_example.instance_variable_set(ivar, val) }
ancestors.each do |ancestor|
until ancestor.after_alls.empty?
@@ -173,8 +173,8 @@ def self.run(reporter)
begin
eval_before_alls(example_group_instance)
result_for_this_group = run_examples(example_group_instance, reporter)
- results_for_descendents = children.map {|child| child.run(reporter)}
- result_for_this_group && (children.empty? ? true : results_for_descendents)
+ results_for_descendants = children.map {|child| child.run(reporter)}
+ result_for_this_group && (children.empty? ? true : results_for_descendants)
ensure
eval_after_alls(example_group_instance)
end
View
2 lib/rspec/core/world.rb
@@ -37,7 +37,7 @@ def shared_example_groups
end
def example_count
- example_groups.collect {|g| g.descendents}.flatten.inject(0) { |sum, g| sum += g.filtered_examples.size }
+ example_groups.collect {|g| g.descendants}.flatten.inject(0) { |sum, g| sum += g.filtered_examples.size }
end
def apply_inclusion_filters(examples, conditions={})
View
6 spec/rspec/core/example_group_spec.rb
@@ -29,15 +29,15 @@ module RSpec::Core
examples_run.should have(1).example
end
- describe "descendents" do
- it "returns self + all descendents" do
+ describe "descendants" do
+ it "returns self + all descendants" do
group = ExampleGroup.describe("parent") do
describe("child") do
describe("grandchild 1") {}
describe("grandchild 2") {}
end
end
- group.descendents.size.should == 4
+ group.descendants.size.should == 4
end
end
end

0 comments on commit fa42f5b

Please sign in to comment.
Something went wrong with that request. Please try again.