Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-20 02:18:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-20 02:18:09 +0300
commit6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch)
treedc4d20fe6064752c0bd323187252c77e0a89144b /spec/lib/gitlab_edition_spec.rb
parent9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff)
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/lib/gitlab_edition_spec.rb')
-rw-r--r--spec/lib/gitlab_edition_spec.rb55
1 files changed, 53 insertions, 2 deletions
diff --git a/spec/lib/gitlab_edition_spec.rb b/spec/lib/gitlab_edition_spec.rb
index 6fc4312252d..46be1471896 100644
--- a/spec/lib/gitlab_edition_spec.rb
+++ b/spec/lib/gitlab_edition_spec.rb
@@ -1,6 +1,7 @@
# frozen_string_literal: true
-require 'spec_helper'
+require 'fast_spec_helper'
+require 'rspec-parameterized'
RSpec.describe GitlabEdition do
def remove_instance_variable(ivar)
@@ -27,7 +28,57 @@ RSpec.describe GitlabEdition do
end
end
- describe 'extensions' do
+ describe '.path_glob' do
+ using RSpec::Parameterized::TableSyntax
+
+ let(:root) { described_class.root.to_s }
+
+ subject { described_class.path_glob(path) }
+
+ before do
+ allow(described_class).to receive(:jh?).and_return(jh)
+ allow(described_class).to receive(:ee?).and_return(ee)
+ end
+
+ where(:ee, :jh, :path, :expected) do
+ false | false | nil | ''
+ true | false | nil | '{,ee/}'
+ true | true | nil | '{,ee/,jh/}'
+ false | true | nil | '{,ee/,jh/}'
+ false | false | 'app/models' | 'app/models'
+ true | false | 'app/models' | '{,ee/}app/models'
+ true | true | 'app/models' | '{,ee/,jh/}app/models'
+ false | true | 'app/models' | '{,ee/,jh/}app/models'
+ end
+
+ with_them do
+ it { is_expected.to eq("#{root}/#{expected}") }
+ end
+ end
+
+ describe '.extension_path_prefixes' do
+ using RSpec::Parameterized::TableSyntax
+
+ subject { described_class.extension_path_prefixes }
+
+ before do
+ allow(described_class).to receive(:jh?).and_return(jh)
+ allow(described_class).to receive(:ee?).and_return(ee)
+ end
+
+ where(:ee, :jh, :expected) do
+ false | false | ''
+ true | false | '{,ee/}'
+ true | true | '{,ee/,jh/}'
+ false | true | '{,ee/,jh/}'
+ end
+
+ with_them do
+ it { is_expected.to eq(expected) }
+ end
+ end
+
+ describe '.extensions' do
context 'when .jh? is true' do
before do
allow(described_class).to receive(:jh?).and_return(true)