Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2018-05-09 17:54:47 +0300
committerDouwe Maan <douwe@selenight.nl>2018-05-09 19:49:38 +0300
commitf6ecb72682000f7261219bbb6ce1ca9352aa473e (patch)
tree55b4f5c9d6b1cef887ae91afb353855ba2cc18a2 /spec/models/repository_spec.rb
parent2de674483aa881461d7afc55ee0d2fd7d9685806 (diff)
Add Repository#xcode_project? method
Diffstat (limited to 'spec/models/repository_spec.rb')
-rw-r--r--spec/models/repository_spec.rb33
1 files changed, 32 insertions, 1 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index 4b736b02b7d..a7755a505d8 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -1733,7 +1733,8 @@ describe Repository do
:gitlab_ci,
:avatar,
:issue_template,
- :merge_request_template
+ :merge_request_template,
+ :xcode_config
])
repository.after_change_head
@@ -2058,6 +2059,36 @@ describe Repository do
end
end
+ describe '#xcode_project?' do
+ before do
+ allow(repository).to receive(:tree).with(:head).and_return(double(:tree, blobs: [blob]))
+ end
+
+ context 'when the root contains a *.xcodeproj file' do
+ let(:blob) { double(:blob, path: 'Foo.xcodeproj') }
+
+ it 'returns true' do
+ expect(repository.xcode_project?).to be_truthy
+ end
+ end
+
+ context 'when the root contains a *.xcworkspace file' do
+ let(:blob) { double(:blob, path: 'Foo.xcworkspace') }
+
+ it 'returns true' do
+ expect(repository.xcode_project?).to be_truthy
+ end
+ end
+
+ context 'when the root contains no XCode config file' do
+ let(:blob) { double(:blob, path: 'subdir/Foo.xcworkspace') }
+
+ it 'returns false' do
+ expect(repository.xcode_project?).to be_falsey
+ end
+ end
+ end
+
describe "#keep_around" do
it "does not fail if we attempt to reference bad commit" do
expect(repository.kept_around?('abc1234')).to be_falsey