null_spec.rb 739 字节
Newer Older
1 2 3
require 'spec_helper'

describe Gitlab::Ci::Config::Node::Null do
4
  let(:null) { described_class.new(nil) }
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

  describe '#leaf?' do
    it 'is leaf node' do
      expect(null).to be_leaf
    end
  end

  describe '#valid?' do
    it 'is always valid' do
      expect(null).to be_valid
    end
  end

  describe '#errors' do
    it 'is does not contain errors' do
      expect(null.errors).to be_empty
    end
  end

  describe '#value' do
    it 'returns nil' do
      expect(null.value).to eq nil
    end
  end
29 30 31 32 33 34 35 36 37 38 39 40

  describe '#relevant?' do
    it 'is not relevant' do
      expect(null.relevant?).to eq false
    end
  end

  describe '#specified?' do
    it 'is not defined' do
      expect(null.specified?).to eq false
    end
  end
41
end