diff options
author | James Lopez <james@jameslopez.es> | 2017-11-03 12:49:08 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-11-06 16:15:11 +0100 |
commit | 11b29641dd833bfad3b9afe53b1c937eacceccee (patch) | |
tree | 58c65f8e059d134c75734ed47444163847947176 | |
parent | 5d960efb962092c5134b96d913ceea013de55813 (diff) | |
download | gitlab-ce-11b29641dd833bfad3b9afe53b1c937eacceccee.tar.gz |
add repo path spec
-rw-r--r-- | spec/lib/gitlab/project_repo_path_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/lib/gitlab/project_repo_path_spec.rb b/spec/lib/gitlab/project_repo_path_spec.rb new file mode 100644 index 00000000000..72d544c757a --- /dev/null +++ b/spec/lib/gitlab/project_repo_path_spec.rb @@ -0,0 +1,35 @@ +require 'spec_helper' + +describe ::Gitlab::ProjectRepoPath do + let(:project_repo_path) { described_class.new('/full/path', '/full/path/to/repo.git') } + + it 'stores the repo path' do + expect(project_repo_path.repo_path).to eq('/full/path/to/repo.git') + end + + it 'stores the group path' do + expect(project_repo_path.group_path).to eq('to') + end + + it 'stores the project name' do + expect(project_repo_path.project_name).to eq('repo') + end + + describe '#wiki?' do + it 'returns true if it is a wiki' do + wiki_path = described_class.new('/full/path', '/full/path/to/my.wiki.git') + + expect(wiki_path.wiki?).to eq(true) + end + + it 'returns false if it is not a wiki' do + expect(project_repo_path.wiki?).to eq(false) + end + end + + describe '#project_full_path' do + it 'returns the project full path' do + expect(project_repo_path.repo_path).to eq('/full/path/to/repo.git') + end + end +end |