Permalink
Browse files

Fix naming.

- this is actually stopping when condition is true.
  • Loading branch information...
coreyhaines authored and dchelimsky committed Jan 28, 2010
1 parent 8f88c6c commit 9f7ec22642e9df93a7383d5da9d482a71b573826
Showing with 4 additions and 4 deletions.
  1. +3 −3 lib/rspec/core/ruby_project.rb
  2. +1 −1 spec/rspec/core/ruby_project_spec.rb
@@ -24,10 +24,10 @@ def determine_root # :nodoc:
end
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
- def ascend_while(&block) # :nodoc:
+ def ascend_until(&block) # :nodoc:
Pathname(File.expand_path('.')).ascend do |path|
return path if block.call(path)
end
@@ -38,7 +38,7 @@ def ascend_while(&block) # :nodoc:
module_function :root
module_function :determine_root
module_function :find_first_parent_containing
- module_function :ascend_while
+ module_function :ascend_until
end
end
end
@@ -6,7 +6,7 @@ module Core
context "with ancestor containing 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'
end
end

0 comments on commit 9f7ec22

Please sign in to comment.