2019-12-04 20:38:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::Template::GitlabCiYmlTemplate do
|
2016-06-22 15:30:34 +05:30
|
|
|
subject { described_class }
|
2016-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
describe '.all' do
|
|
|
|
it 'combines the globals and rest' do
|
|
|
|
all = subject.all.map(&:name)
|
|
|
|
|
2016-09-13 17:45:13 +05:30
|
|
|
expect(all).to include('Elixir')
|
|
|
|
expect(all).to include('Docker')
|
2016-06-02 11:05:42 +05:30
|
|
|
expect(all).to include('Ruby')
|
|
|
|
end
|
2020-11-24 15:15:51 +05:30
|
|
|
|
|
|
|
it 'does not include Browser-Performance template in FOSS' do
|
|
|
|
all = subject.all.map(&:name)
|
|
|
|
|
|
|
|
expect(all).not_to include('Browser-Performance') unless Gitlab.ee?
|
|
|
|
end
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
describe '#content' do
|
|
|
|
it 'loads the full file' do
|
2018-12-05 23:21:45 +05:30
|
|
|
gitignore = subject.new(Rails.root.join('lib/gitlab/ci/templates/Ruby.gitlab-ci.yml'))
|
2016-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
expect(gitignore.name).to eq 'Ruby'
|
2016-09-13 17:45:13 +05:30
|
|
|
expect(gitignore.content).to start_with('#')
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
|
|
|
end
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
it_behaves_like 'file template shared examples', 'Ruby', '.gitlab-ci.yml'
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|