Add spec for parsers factory
This commit is contained in:
parent
41f28a9ffa
commit
3d13cd2c9e
1 changed files with 23 additions and 0 deletions
23
spec/lib/gitlab/ci/parsers_spec.rb
Normal file
23
spec/lib/gitlab/ci/parsers_spec.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
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::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(NameError)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue