diff options
Diffstat (limited to 'spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb')
-rw-r--r-- | spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb b/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb index 3004de6fe08..55444114d39 100644 --- a/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb +++ b/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb @@ -6,10 +6,6 @@ RSpec.describe Gitlab::Template::GitlabCiYmlTemplate do subject { described_class } describe '.all' do - it 'strips the gitlab-ci suffix' do - expect(subject.all.first.name).not_to end_with('.gitlab-ci.yml') - end - it 'combines the globals and rest' do all = subject.all.map(&:name) @@ -17,34 +13,6 @@ RSpec.describe Gitlab::Template::GitlabCiYmlTemplate do expect(all).to include('Docker') expect(all).to include('Ruby') end - - it 'ensure that the template name is used exactly once' do - all = subject.all.group_by(&:name) - duplicates = all.select { |_, templates| templates.length > 1 } - - expect(duplicates).to be_empty - end - end - - describe '.find' do - it 'returns nil if the file does not exist' do - expect(subject.find('mepmep-yadida')).to be nil - end - - it 'returns the GitlabCiYml object of a valid file' do - ruby = subject.find('Ruby') - - expect(ruby).to be_a described_class - expect(ruby.name).to eq('Ruby') - end - end - - describe '.by_category' do - it 'returns sorted results' do - result = described_class.by_category('General') - - expect(result).to eq(result.sort) - end end describe '#content' do @@ -56,13 +24,5 @@ RSpec.describe Gitlab::Template::GitlabCiYmlTemplate do end end - describe '#<=>' do - it 'sorts lexicographically' do - one = described_class.new('a.gitlab-ci.yml') - other = described_class.new('z.gitlab-ci.yml') - - expect(one.<=>(other)).to be(-1) - expect([other, one].sort).to eq([one, other]) - end - end + it_behaves_like 'file template shared examples', 'Ruby', '.gitlab-ci.yml' end |