2019-07-25 01:21:37 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-08-18 05:11:27 -04:00
|
|
|
require 'fast_spec_helper'
|
2016-07-10 17:13:06 -04:00
|
|
|
|
2020-06-24 14:09:03 -04:00
|
|
|
RSpec.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
|
2019-12-18 07:07:48 -05: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 05:08:35 -04: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 17:13:06 -04:00
|
|
|
end
|
|
|
|
end
|