summaryrefslogtreecommitdiff
path: root/qa/spec
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-02-12 23:25:18 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-02-12 23:49:09 +0800
commit565fdd63cf49c266c7a6a2a0d2a843339a9d30e6 (patch)
tree3567619e22cdf16df541c67aaf6f7809d8f4e14b /qa/spec
parent2f34ef34fa230c1954e47504cd8ead1a6ab019fe (diff)
downloadgitlab-ce-565fdd63cf49c266c7a6a2a0d2a843339a9d30e6.tar.gz
Rearrange the test structure and introduce
a new repository location class.
Diffstat (limited to 'qa/spec')
-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