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

metadata_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: fe0b9481039055c9809dfbaec47b774491303ae4 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Ci::Reports::Sbom::Metadata, feature_category: :dependency_management do
  let(:tools) do
    [
      {
        vendor: "vendor",
        name: "Gemnasium",
        version: "2.34.0"
      }
    ]
  end

  let(:authors) do
    [
      {
        name: "author_name",
        email: "support@gitlab.com"
      }
    ]
  end

  let(:properties) do
    [
      {
        name: "property_name",
        value: "package-lock.json"
      }
    ]
  end

  let(:timestamp) { "2020-04-13T20:20:39+00:00" }

  subject(:metadata) do
    metadata = described_class.new(
      tools: tools,
      authors: authors,
      properties: properties
    )
    metadata.timestamp = timestamp
    metadata
  end

  it 'has correct attributes' do
    expect(metadata).to have_attributes(
      tools: tools,
      authors: authors,
      properties: properties,
      timestamp: timestamp
    )
  end
end