2016-07-10 17:13:06 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2017-07-10 10:24:02 -04:00
|
|
|
describe Gitlab::DependencyLinker do
|
2016-07-10 17:13:06 -04:00
|
|
|
describe '.link' do
|
|
|
|
it 'links using GemfileLinker' do
|
|
|
|
blob_name = 'Gemfile'
|
|
|
|
|
|
|
|
expect(described_class::GemfileLinker).to receive(:link)
|
|
|
|
|
|
|
|
described_class.link(blob_name, nil, nil)
|
|
|
|
end
|
2017-05-16 16:26:31 -04:00
|
|
|
|
|
|
|
it 'links using GemspecLinker' do
|
|
|
|
blob_name = 'gitlab_git.gemspec'
|
|
|
|
|
|
|
|
expect(described_class::GemspecLinker).to receive(:link)
|
|
|
|
|
|
|
|
described_class.link(blob_name, nil, nil)
|
|
|
|
end
|
2017-05-16 16:27:50 -04:00
|
|
|
|
|
|
|
it 'links using PackageJsonLinker' do
|
|
|
|
blob_name = 'package.json'
|
|
|
|
|
|
|
|
expect(described_class::PackageJsonLinker).to receive(:link)
|
|
|
|
|
|
|
|
described_class.link(blob_name, nil, nil)
|
|
|
|
end
|
2017-05-16 16:28:11 -04:00
|
|
|
|
|
|
|
it 'links using ComposerJsonLinker' do
|
|
|
|
blob_name = 'composer.json'
|
|
|
|
|
|
|
|
expect(described_class::ComposerJsonLinker).to receive(:link)
|
|
|
|
|
|
|
|
described_class.link(blob_name, nil, nil)
|
|
|
|
end
|
2017-05-16 16:28:52 -04:00
|
|
|
|
|
|
|
it 'links using PodfileLinker' do
|
|
|
|
blob_name = 'Podfile'
|
|
|
|
|
|
|
|
expect(described_class::PodfileLinker).to receive(:link)
|
|
|
|
|
|
|
|
described_class.link(blob_name, nil, nil)
|
|
|
|
end
|
2017-05-16 16:29:13 -04:00
|
|
|
|
|
|
|
it 'links using PodspecLinker' do
|
|
|
|
blob_name = 'Reachability.podspec'
|
|
|
|
|
|
|
|
expect(described_class::PodspecLinker).to receive(:link)
|
|
|
|
|
|
|
|
described_class.link(blob_name, nil, nil)
|
|
|
|
end
|
2017-05-16 16:29:34 -04:00
|
|
|
|
|
|
|
it 'links using PodspecJsonLinker' do
|
|
|
|
blob_name = 'AFNetworking.podspec.json'
|
|
|
|
|
|
|
|
expect(described_class::PodspecJsonLinker).to receive(:link)
|
|
|
|
|
|
|
|
described_class.link(blob_name, nil, nil)
|
|
|
|
end
|
2017-05-16 16:29:56 -04:00
|
|
|
|
|
|
|
it 'links using CartfileLinker' do
|
|
|
|
blob_name = 'Cartfile'
|
|
|
|
|
|
|
|
expect(described_class::CartfileLinker).to receive(:link)
|
|
|
|
|
|
|
|
described_class.link(blob_name, nil, nil)
|
|
|
|
end
|
2017-05-16 16:30:18 -04:00
|
|
|
|
|
|
|
it 'links using GodepsJsonLinker' do
|
|
|
|
blob_name = 'Godeps.json'
|
|
|
|
|
|
|
|
expect(described_class::GodepsJsonLinker).to receive(:link)
|
|
|
|
|
|
|
|
described_class.link(blob_name, nil, nil)
|
|
|
|
end
|
2017-05-16 16:30:29 -04:00
|
|
|
|
|
|
|
it 'links using RequirementsTxtLinker' do
|
|
|
|
blob_name = 'requirements.txt'
|
|
|
|
|
|
|
|
expect(described_class::RequirementsTxtLinker).to receive(:link)
|
|
|
|
|
|
|
|
described_class.link(blob_name, nil, nil)
|
|
|
|
end
|
2016-07-10 17:13:06 -04:00
|
|
|
end
|
|
|
|
end
|