diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-08-03 14:13:27 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-08-03 14:13:27 +0300 |
commit | 3d13cd2c9e771efeec7d1df0671e39eb553665e0 (patch) | |
tree | 8df6603c3ba5405a65526415de26b3e7c4e9a094 /spec | |
parent | 41f28a9ffabf4eb45c53836ea4de3b7a49229eaa (diff) |
Add spec for parsers factory
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/ci/parsers_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/parsers_spec.rb b/spec/lib/gitlab/ci/parsers_spec.rb new file mode 100644 index 00000000000..2fa83c4abae --- /dev/null +++ b/spec/lib/gitlab/ci/parsers_spec.rb @@ -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 |