summaryrefslogtreecommitdiff
path: root/qa/spec/git
diff options
context:
space:
mode:
Diffstat (limited to 'qa/spec/git')
-rw-r--r--qa/spec/git/repository/location_spec.rb (renamed from qa/spec/git/repository_spec.rb)15
1 files changed, 9 insertions, 6 deletions
diff --git a/qa/spec/git/repository_spec.rb b/qa/spec/git/repository/location_spec.rb
index ae58355d199..c1fe01becd7 100644
--- a/qa/spec/git/repository_spec.rb
+++ b/qa/spec/git/repository/location_spec.rb
@@ -1,10 +1,10 @@
-describe QA::Git::Repository do
- describe '.parse_uri' do
+describe QA::Git::Repository::Location do
+ describe '.parse' do
context 'when URI starts with ssh://' do
context 'when URI has port' do
it 'parses correctly' do
uri = described_class
- .parse_uri('ssh://git@qa.test:2222/sandbox/qa/repo.git')
+ .parse('ssh://git@qa.test:2222/sandbox/qa/repo.git')
expect(uri.user).to eq('git')
expect(uri.host).to eq('qa.test')
@@ -16,10 +16,11 @@ describe QA::Git::Repository do
context 'when URI does not have port' do
it 'parses correctly' do
uri = described_class
- .parse_uri('ssh://git@qa.test/sandbox/qa/repo.git')
+ .parse('ssh://git@qa.test/sandbox/qa/repo.git')
expect(uri.user).to eq('git')
expect(uri.host).to eq('qa.test')
+ expect(uri.port).to eq(22)
expect(uri.path).to eq('/sandbox/qa/repo.git')
end
end
@@ -29,10 +30,11 @@ describe QA::Git::Repository do
context 'when host does not have colons' do
it 'parses correctly' do
uri = described_class
- .parse_uri('git@qa.test:sandbox/qa/repo.git')
+ .parse('git@qa.test:sandbox/qa/repo.git')
expect(uri.user).to eq('git')
expect(uri.host).to eq('qa.test')
+ expect(uri.port).to eq(22)
expect(uri.path).to eq('/sandbox/qa/repo.git')
end
end
@@ -40,10 +42,11 @@ describe QA::Git::Repository do
context 'when host has a colon' do
it 'parses correctly' do
uri = described_class
- .parse_uri('[git@qa:test]:sandbox/qa/repo.git')
+ .parse('[git@qa:test]:sandbox/qa/repo.git')
expect(uri.user).to eq('git')
expect(uri.host).to eq('qa%3Atest')
+ expect(uri.port).to eq(22)
expect(uri.path).to eq('/sandbox/qa/repo.git')
end
end