diff options
author | Gilbert Roulot <groulot@gitlab.com> | 2018-11-05 14:45:36 +0100 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2018-12-11 11:39:22 +0100 |
commit | e6226e8cb3d7e79500482ba2cef604133f667381 (patch) | |
tree | acf0f3d0b822f122da9125333f210ccce477c0d0 /spec/lib/gitlab/ci/parsers_spec.rb | |
parent | 85f430cb3cde4ff8c4d24c1b2a426670e38dd44f (diff) | |
download | gitlab-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.rb | 25 |
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 |