Commit 305c8751 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Fix the use to Git::Location

parent 58d1ad56
...@@ -37,7 +37,7 @@ module QA ...@@ -37,7 +37,7 @@ module QA
end end
def repository_location_uri def repository_location_uri
Git::Repository::Location.parse(repository_location) Git::Location.new(repository_location)
end end
def project_name def project_name
......
describe QA::Git::Location do describe QA::Git::Location do
describe '.parse' do describe '.new' do
context 'when URI starts with ssh://' do context 'when URI starts with ssh://' do
context 'when URI has port' do context 'when URI has port' do
it 'parses correctly' do it 'parses correctly' do
uri = described_class uri = described_class
.parse('ssh://git@qa.test:2222/sandbox/qa/repo.git') .new('ssh://git@qa.test:2222/sandbox/qa/repo.git')
expect(uri.user).to eq('git') expect(uri.user).to eq('git')
expect(uri.host).to eq('qa.test') expect(uri.host).to eq('qa.test')
...@@ -16,7 +16,7 @@ describe QA::Git::Location do ...@@ -16,7 +16,7 @@ describe QA::Git::Location do
context 'when URI does not have port' do context 'when URI does not have port' do
it 'parses correctly' do it 'parses correctly' do
uri = described_class uri = described_class
.parse('ssh://git@qa.test/sandbox/qa/repo.git') .new('ssh://git@qa.test/sandbox/qa/repo.git')
expect(uri.user).to eq('git') expect(uri.user).to eq('git')
expect(uri.host).to eq('qa.test') expect(uri.host).to eq('qa.test')
...@@ -30,7 +30,7 @@ describe QA::Git::Location do ...@@ -30,7 +30,7 @@ describe QA::Git::Location do
context 'when host does not have colons' do context 'when host does not have colons' do
it 'parses correctly' do it 'parses correctly' do
uri = described_class uri = described_class
.parse('git@qa.test:sandbox/qa/repo.git') .new('git@qa.test:sandbox/qa/repo.git')
expect(uri.user).to eq('git') expect(uri.user).to eq('git')
expect(uri.host).to eq('qa.test') expect(uri.host).to eq('qa.test')
...@@ -42,7 +42,7 @@ describe QA::Git::Location do ...@@ -42,7 +42,7 @@ describe QA::Git::Location do
context 'when host has a colon' do context 'when host has a colon' do
it 'parses correctly' do it 'parses correctly' do
uri = described_class uri = described_class
.parse('[git@qa:test]:sandbox/qa/repo.git') .new('[git@qa:test]:sandbox/qa/repo.git')
expect(uri.user).to eq('git') expect(uri.user).to eq('git')
expect(uri.host).to eq('qa%3Atest') expect(uri.host).to eq('qa%3Atest')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment