debian-mirror-gitlab/spec/lib/gitlab/ci/parsers/test_spec.rb

24 lines
558 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
require 'spec_helper'
2018-12-05 23:21:45 +05:30
describe Gitlab::Ci::Parsers::Test 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
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
2018-12-05 23:21:45 +05:30
expect { subject }.to raise_error(Gitlab::Ci::Parsers::Test::ParserNotFoundError)
2018-11-18 11:00:15 +05:30
end
end
end
end