diff options
Diffstat (limited to 'spec/integration/c/conan_spec.rb')
| -rw-r--r-- | spec/integration/c/conan_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/integration/c/conan_spec.rb b/spec/integration/c/conan_spec.rb index 3c2ac45..cdbf029 100644 --- a/spec/integration/c/conan_spec.rb +++ b/spec/integration/c/conan_spec.rb @@ -61,4 +61,33 @@ RSpec.describe "conan" do specify { expect(subject.licenses_for('protobuf')).to match_array(['BSD-3-Clause']) } specify { expect(subject.licenses_for('protoc_installer')).to match_array(['BSD-3-Clause']) } end + + context "when pulling packages from a custom conan remote" do + subject { runner.scan } + + let(:package_name) { "#{project_namespace.tr('/', '+')}+#{project_name}/stable" } + let(:project_namespace) { ENV.fetch('CI_PROJECT_NAMESPACE', 'gitlab-org/security-products') } + let(:project_name) { ENV.fetch('CI_PROJECT_NAME', 'license-management') } + let(:api_url) { ENV.fetch('CI_API_V4_URL', 'https://gitlab.com/api/v4') } + + before do + runner.mount(dir: fixture_file('c/conan/example-project')) + runner.add_file('conanfile.txt', fixture_file_content('c/conan/example-project/conanfile.txt.erb', package_name: package_name)) + runner.add_file('.conan/remotes.json') do + JSON.pretty_generate({ + remotes: [ + { + name: 'gitlab', + url: "#{api_url}/packages/conan", + verify_ssl: true + } + ] + }) + end + end + + specify { expect(subject).to match_schema } + specify { expect(subject.dependency_names).to match_array(['example']) } + specify { expect(subject.licenses_for('example')).to match_array(['MIT']) } + end end |
