summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/parsers_spec.rb
diff options
context:
space:
mode:
authorGilbert Roulot <groulot@gitlab.com>2018-11-05 14:45:36 +0100
committerKamil TrzciƄski <ayufan@ayufan.eu>2018-12-11 11:39:22 +0100
commite6226e8cb3d7e79500482ba2cef604133f667381 (patch)
treeacf0f3d0b822f122da9125333f210ccce477c0d0 /spec/lib/gitlab/ci/parsers_spec.rb
parent85f430cb3cde4ff8c4d24c1b2a426670e38dd44f (diff)
downloadgitlab-ce-e6226e8cb3d7e79500482ba2cef604133f667381.tar.gz
Generalise test compare service
It adds a base class for CompareTestReportsService containing common code with CompareLicenseManagementReportsService which is present in GitLab Enterprise Edition.
Diffstat (limited to 'spec/lib/gitlab/ci/parsers_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/parsers_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/parsers_spec.rb b/spec/lib/gitlab/ci/parsers_spec.rb
new file mode 100644
index 00000000000..4b647bffe59
--- /dev/null
+++ b/spec/lib/gitlab/ci/parsers_spec.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe Gitlab::Ci::Parsers do
+ describe '.fabricate!' do
+ subject { described_class.fabricate!(file_type) }
+
+ context 'when file_type exists' do
+ let(:file_type) { 'junit' }
+
+ it 'fabricates the class' do
+ is_expected.to be_a(described_class::Test::Junit)
+ end
+ end
+
+ context 'when file_type does not exist' do
+ let(:file_type) { 'undefined' }
+
+ it 'raises an error' do
+ expect { subject }.to raise_error(Gitlab::Ci::Parsers::ParserNotFoundError)
+ end
+ end
+ end
+end