summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/parsers/test_spec.rb
blob: 0b85b43267772069d5be3f7ebf21575485341805 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'spec_helper'

describe Gitlab::Ci::Parsers::Test 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(Gitlab::Ci::Parsers::Test::ParserNotFoundError)
      end
    end
  end
end