2019-02-15 15:39:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
describe Gitlab::Ci::Parsers do
|
2018-11-18 11:00:15 +05:30
|
|
|
describe '.fabricate!' do
|
|
|
|
subject { described_class.fabricate!(file_type) }
|
|
|
|
|
|
|
|
context 'when file_type exists' do
|
|
|
|
let(:file_type) { 'junit' }
|
|
|
|
|
|
|
|
it 'fabricates the class' do
|
2019-02-15 15:39:39 +05:30
|
|
|
is_expected.to be_a(described_class::Test::Junit)
|
2018-11-18 11:00:15 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when file_type does not exist' do
|
|
|
|
let(:file_type) { 'undefined' }
|
|
|
|
|
|
|
|
it 'raises an error' do
|
2019-02-15 15:39:39 +05:30
|
|
|
expect { subject }.to raise_error(Gitlab::Ci::Parsers::ParserNotFoundError)
|
2018-11-18 11:00:15 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|