gitlab-org--gitlab-foss/spec/lib/gitlab/ci/parsers_spec.rb
Gilbert Roulot e6226e8cb3 Generalise test compare service
It adds a base class for CompareTestReportsService
containing common code with CompareLicenseManagementReportsService
which is present in GitLab Enterprise Edition.
2018-12-11 11:39:22 +01:00

25 lines
583 B
Ruby

# 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