Skip to content

Commit

Permalink
simplify each_ancestor in each_ancestor (again, don't need to add Exa…
Browse files Browse the repository at this point in the history
…mpleMethods since it is already included in the group)
  • Loading branch information
dchelimsky committed Oct 20, 2008
1 parent 2426eda commit 8dabd9f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ included in the group.
* mingw indicates windows too (thanks to Luis Lavena for the tip)
* improved output for partial mock expecation failures
* it_should_behave_like now accepts n names of shared groups
* eliminated redundant inclusion/extension of ExampleGroupMethods

* 5 bug fixes

Expand Down
2 changes: 1 addition & 1 deletion lib/spec/example/example_group_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def each_ancestor(superclass_last=false)
superclass_last ? classes << current_class : classes.unshift(current_class)
current_class = current_class.superclass
end

classes.each do |example_group|
yield example_group
end
Expand Down
5 changes: 0 additions & 5 deletions lib/spec/example/example_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ module Spec
module Example
module ExampleMethods

class << self
# FIXME - this is defined on ExampleGroupMethods too - why in both places?
attr_reader :description_args
end

extend ModuleReopeningFix

def execute(options, instance_variables)
Expand Down
6 changes: 1 addition & 5 deletions lib/spec/example/shared_example_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ def included(mod) # :nodoc:
end

def each_ancestor(superclass_last=false)
classes = [self]
superclass_last ? classes << ExampleMethods : classes.unshift(ExampleMethods)
classes.each do |example_group|
yield example_group
end
yield self
end
end
end
Expand Down

0 comments on commit 8dabd9f

Please sign in to comment.