Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-08-03 14:13:27 +0300
committerShinya Maeda <shinya@gitlab.com>2018-08-03 14:13:27 +0300
commit3d13cd2c9e771efeec7d1df0671e39eb553665e0 (patch)
tree8df6603c3ba5405a65526415de26b3e7c4e9a094 /spec/lib
parent41f28a9ffabf4eb45c53836ea4de3b7a49229eaa (diff)
Add spec for parsers factory
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/ci/parsers_spec.rb23
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