diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-12-22 11:28:46 -0200 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2018-01-03 16:13:32 -0200 |
commit | 62ee2ccfcc1d765cf2b80ba8f7a226855f2f8a2f (patch) | |
tree | 4ee549ba1422f40fa4bdee7b6f586a63b179061d /spec | |
parent | 6c95c771fb9a3c71d176aa996b82096a8e0a3f7a (diff) | |
download | gitlab-ce-62ee2ccfcc1d765cf2b80ba8f7a226855f2f8a2f.tar.gz |
Refactoring spec for Gitlab::BareRepositoryImport::Repository
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/bare_repository_import/repository_spec.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/spec/lib/gitlab/bare_repository_import/repository_spec.rb b/spec/lib/gitlab/bare_repository_import/repository_spec.rb index e0b7d16ebb7..39f2cfe6175 100644 --- a/spec/lib/gitlab/bare_repository_import/repository_spec.rb +++ b/spec/lib/gitlab/bare_repository_import/repository_spec.rb @@ -39,15 +39,14 @@ describe ::Gitlab::BareRepositoryImport::Repository do end describe '#project_full_path' do - it 'returns the project full path' do - expect(subject.repo_path).to eq('/full/path/to/repo.git') + it 'returns the project full path with trailing slash in the root path' do expect(subject.project_full_path).to eq('to/repo') end - it 'with no trailing slash in the root path' do - repo_path = described_class.new('/full/path', '/full/path/to/repo.git') + it 'returns the project full path with no trailing slash in the root path' do + subject = described_class.new('/full/path', '/full/path/to/repo.git') - expect(repo_path.project_full_path).to eq('to/repo') + expect(subject.project_full_path).to eq('to/repo') end end end @@ -109,7 +108,13 @@ describe ::Gitlab::BareRepositoryImport::Repository do end describe '#project_full_path' do - it 'returns the project full path' do + it 'returns the project full path with trailing slash in the root path' do + expect(subject.project_full_path).to eq('to/repo') + end + + it 'returns the project full path with no trailing slash in the root path' do + subject = described_class.new(root_path[0...-1], repo_path) + expect(subject.project_full_path).to eq('to/repo') end end |