Skip to content
Snippets Groups Projects
Commit 1c3ece12 authored by Misty De Meo's avatar Misty De Meo
Browse files

Tap.each: return an enumerable when no block given

parent 1cae6dd6
No related branches found
No related tags found
No related merge requests found
......@@ -486,6 +486,8 @@ class Tap
def self.each
return unless TAP_DIRECTORY.directory?
return to_enum unless block_given?
TAP_DIRECTORY.subdirs.each do |user|
user.subdirs.each do |repo|
yield fetch(user.basename.to_s, repo.basename.to_s)
......
......@@ -297,6 +297,12 @@ describe Tap do
subject.config["foo"] = nil
expect(subject.config["foo"]).to be nil
end
describe "#each" do
it "returns an enumerator if no block is passed" do
expect(described_class.each).to be_an_instance_of(Enumerator)
end
end
end
describe CoreTap do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment