Welcome to mirror list, hosted at ThFree Co, Russian Federation.

source_spec.rb « sbom « reports « ci « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 343c0d8c15cf1eb145d5d13c86e72f34048a2d11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

require 'fast_spec_helper'

RSpec.describe Gitlab::Ci::Reports::Sbom::Source do
  let(:attributes) do
    {
      type: :dependency_scanning,
      data: {
        'category' => 'development',
        'input_file' => { 'path' => 'package-lock.json' },
        'source_file' => { 'path' => 'package.json' },
        'package_manager' => { 'name' => 'npm' },
        'language' => { 'name' => 'JavaScript' }
      }
    }
  end

  subject { described_class.new(**attributes) }

  it 'has correct attributes' do
    expect(subject).to have_attributes(
      source_type: attributes[:type],
      data: attributes[:data]
    )
  end
end