diff options
Diffstat (limited to 'spec/lib/gitlab/ci/config/interpolation/functions/base_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/config/interpolation/functions/base_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/config/interpolation/functions/base_spec.rb b/spec/lib/gitlab/ci/config/interpolation/functions/base_spec.rb new file mode 100644 index 00000000000..c193e88dbe2 --- /dev/null +++ b/spec/lib/gitlab/ci/config/interpolation/functions/base_spec.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +require 'fast_spec_helper' + +RSpec.describe Gitlab::Ci::Config::Interpolation::Functions::Base, feature_category: :pipeline_composition do + let(:custom_function_klass) do + Class.new(described_class) do + def self.function_expression_pattern + /.*/ + end + + def self.name + 'test_function' + end + end + end + + it 'defines an expected interface for child classes' do + expect { described_class.function_expression_pattern }.to raise_error(NotImplementedError) + expect { described_class.name }.to raise_error(NotImplementedError) + expect { custom_function_klass.new('test').execute('input') }.to raise_error(NotImplementedError) + end +end |