summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/reports/sbom/reports_spec.rb
blob: 75ea91251eb26a0c25b20acd48bbfba167e4d591 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'fast_spec_helper'

RSpec.describe Gitlab::Ci::Reports::Sbom::Reports do
  subject(:reports_list) { described_class.new }

  describe '#add_report' do
    let(:rep1) { Gitlab::Ci::Reports::Sbom::Report.new }
    let(:rep2) { Gitlab::Ci::Reports::Sbom::Report.new }

    it 'appends the report to the report list' do
      reports_list.add_report(rep1)
      reports_list.add_report(rep2)

      expect(reports_list.reports.length).to eq(2)
      expect(reports_list.reports.first).to eq(rep1)
      expect(reports_list.reports.last).to eq(rep2)
    end
  end
end