Commit 9a3a78e9 authored by Orta's avatar Orta

Merge pull request #4957 from CocoaPods/seg-no-master-repo

[SourcesManager] Dont return non-functioning master sources
parents fdf990bb 5c71810d
...@@ -16,6 +16,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -16,6 +16,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Marius Rackwitz](https://github.com/mrackwitz) [Marius Rackwitz](https://github.com/mrackwitz)
[#4954](https://github.com/CocoaPods/CocoaPods/pull/4954) [#4954](https://github.com/CocoaPods/CocoaPods/pull/4954)
* Fix saying the `master` specs repo exists when it has not been set up.
[Samuel Giddins](https://github.com/segiddins)
[#4955](https://github.com/CocoaPods/CocoaPods/issues/4955)
## 1.0.0.beta.4 (2016-02-24) ## 1.0.0.beta.4 (2016-02-24)
......
...@@ -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