2019-07-25 05:21:37 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 07:56:52 +00:00
|
|
|
require 'spec_helper'
|
2016-07-10 21:13:06 +00:00
|
|
|
|
2020-06-24 18:09:03 +00:00
|
|
|
RSpec.describe Gitlab::DependencyLinker do
|
2016-07-10 21:13:06 +00: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 20:26:31 +00: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 20:27:50 +00: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 20:28:11 +00: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 20:28:52 +00: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 20:29:13 +00: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 20:29:34 +00: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 20:29:56 +00: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 20:30:18 +00: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 20:30:29 +00: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
|
2019-12-18 12:07:48 +00:00
|
|
|
|
|
|
|
it 'links using CargoTomlLinker' do
|
|
|
|
blob_name = 'Cargo.toml'
|
|
|
|
|
|
|
|
expect(described_class::CargoTomlLinker).to receive(:link)
|
|
|
|
|
|
|
|
described_class.link(blob_name, nil, nil)
|
|
|
|
end
|
2020-06-10 09:08:35 +00:00
|
|
|
|
|
|
|
it 'links using GoModLinker' do
|
|
|
|
blob_name = 'go.mod'
|
|
|
|
|
|
|
|
expect(described_class::GoModLinker).to receive(:link)
|
|
|
|
|
|
|
|
described_class.link(blob_name, nil, nil)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'links using GoSumLinker' do
|
|
|
|
blob_name = 'go.sum'
|
|
|
|
|
|
|
|
expect(described_class::GoSumLinker).to receive(:link)
|
|
|
|
|
|
|
|
described_class.link(blob_name, nil, nil)
|
|
|
|
end
|
2016-07-10 21:13:06 +00:00
|
|
|
end
|
|
|
|
end
|