Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix naming.

- this is actually stopping when condition is true.
  • Loading branch information...
commit 9f7ec22642e9df93a7383d5da9d482a71b573826 1 parent 8f88c6c
@coreyhaines coreyhaines authored dchelimsky committed
View
6 lib/rspec/core/ruby_project.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
View
2  spec/rspec/core/ruby_project_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.