summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/pipeline/expression/lexeme/null_spec.rb
blob: 49686d1a9bde5c7cadf7d00140daea2c7a71ed96 (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'

RSpec.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