Commit de5b9a1c authored by Samuel Giddins's avatar Samuel Giddins

[SourcesManager] Dont return non-functioning master sources

parent fdf990bb
...@@ -103,7 +103,7 @@ module Pod ...@@ -103,7 +103,7 @@ module Pod
# @return [Array<Source>] The CocoaPods Master Repo source. # @return [Array<Source>] The CocoaPods Master Repo source.
# #
def master def master
sources(['master']) sources(['master']).select { |s| s.repo.directory? }
end end
# Search the appropriate sources to match the set for the given dependency. # Search the appropriate sources to match the set for the given dependency.
......
...@@ -431,6 +431,11 @@ module Pod ...@@ -431,6 +431,11 @@ module Pod
SourcesManager.master_repo_dir.to_s.should.match %r{fixtures/spec-repos/master} SourcesManager.master_repo_dir.to_s.should.match %r{fixtures/spec-repos/master}
end end
it 'returns an empty array for master sources when the master repo has not been set up' do
Pathname.any_instance.stubs(:directory?).returns(false)
SourcesManager.master.should == []
end
it 'returns whether the master repo is functional' do it 'returns whether the master repo is functional' do
SourcesManager.master_repo_functional?.should.be.true SourcesManager.master_repo_functional?.should.be.true
config.repos_dir = SpecHelper.temporary_directory config.repos_dir = SpecHelper.temporary_directory
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment