Skip to content

Commit

Permalink
Fix naming.
Browse files Browse the repository at this point in the history
- this is actually stopping when condition is true.
  • Loading branch information
coreyhaines authored and dchelimsky committed Jan 29, 2010
1 parent 8f88c6c commit 9f7ec22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/rspec/core/ruby_project.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def determine_root # :nodoc:
end end


def find_first_parent_containing(dir) # :nodoc: def find_first_parent_containing(dir) # :nodoc:
ascend_while {|path| File.exists?(File.join(path, dir))} ascend_until {|path| File.exists?(File.join(path, dir))}
end end


def ascend_while(&block) # :nodoc: def ascend_until(&block) # :nodoc:
Pathname(File.expand_path('.')).ascend do |path| Pathname(File.expand_path('.')).ascend do |path|
return path if block.call(path) return path if block.call(path)
end end
Expand All @@ -38,7 +38,7 @@ def ascend_while(&block) # :nodoc:
module_function :root module_function :root
module_function :determine_root module_function :determine_root
module_function :find_first_parent_containing module_function :find_first_parent_containing
module_function :ascend_while module_function :ascend_until
end end
end end
end end
2 changes: 1 addition & 1 deletion spec/rspec/core/ruby_project_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Core


context "with ancestor containing spec directory" do context "with ancestor containing spec directory" do
it "returns ancestor containing the spec directory" do it "returns ancestor containing the spec directory" do
RubyProject.stub(:ascend_while).and_return('foodir') RubyProject.stub(:ascend_until).and_return('foodir')
RubyProject.determine_root.should == 'foodir' RubyProject.determine_root.should == 'foodir'
end end
end end
Expand Down

0 comments on commit 9f7ec22

Please sign in to comment.