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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/ci/reports/sbom/report_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/reports/sbom/report_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/reports/sbom/report_spec.rb b/spec/lib/gitlab/ci/reports/sbom/report_spec.rb
index 6ffa93e5fc8..f9a83378f46 100644
--- a/spec/lib/gitlab/ci/reports/sbom/report_spec.rb
+++ b/spec/lib/gitlab/ci/reports/sbom/report_spec.rb
@@ -5,6 +5,21 @@ require 'spec_helper'
RSpec.describe Gitlab::Ci::Reports::Sbom::Report do
subject(:report) { described_class.new }
+ describe '#valid?' do
+ context 'when there are no errors' do
+ it { is_expected.to be_valid }
+ end
+
+ context 'when report contains errors' do
+ before do
+ report.add_error('error1')
+ report.add_error('error2')
+ end
+
+ it { is_expected.not_to be_valid }
+ end
+ end
+
describe '#add_error' do
it 'appends errors to a list' do
report.add_error('error1')