summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/pipeline/expression/lexeme/null_spec.rb
blob: 7013c6bacbb8a4c23d85af0fec48d8acea83dca9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

require 'spec_helper'

describe Gitlab::Ci::Pipeline::Expression::Lexeme::Null do
  describe '.build' do
    it 'creates a new instance of the token' do
      expect(described_class.build('null'))
        .to be_a(described_class)
    end
  end

  describe '.type' do
    it 'is a value lexeme' do
      expect(described_class.type).to eq :value
    end
  end

  describe '#evaluate' do
    it 'always evaluates to `nil`' do
      expect(described_class.new('null').evaluate).to be_nil
    end
  end
end