Skip to content
Snippets Groups Projects
Commit 8a97d03f authored by Balasankar "Balu" C's avatar Balasankar "Balu" C
Browse files

Merge branch 'generic-package-stubs' into 'master'

Add support to our spec macros for stubbing generic package suffixes

See merge request gitlab-org/omnibus-gitlab!5069
parents d5574032 cb795097
No related branches found
No related tags found
2 merge requests!39Bumped oldstable branch to Heptapod 0.21,!31GitLab 13.10
......@@ -39,4 +39,17 @@
allow(ENV).to receive(:[]).with(var).and_return(value)
end
def stub_is_package_version(package, value)
allow(File).to receive(:read).with('VERSION').and_return(value ? "1.2.3-#{package}" : '1.2.3')
end
def stub_is_package_env(package, value)
stub_env_var(package, value.nil? ? '' : value.to_s)
end
def stub_is_package(package, value)
stub_is_package_version(package, value)
stub_is_package_env(package, value)
end
def stub_is_ee_version(value)
......@@ -42,5 +55,5 @@
def stub_is_ee_version(value)
allow(File).to receive(:read).with('VERSION').and_return(value ? '1.2.3-ee' : '1.2.3')
stub_is_package_version('ee', value)
end
def stub_is_ee_env(value)
......@@ -44,7 +57,7 @@
end
def stub_is_ee_env(value)
stub_env_var('ee', value.nil? ? '' : value.to_s)
stub_is_package_env('ee', value)
end
def stub_is_ee(value)
......@@ -48,8 +61,7 @@
end
def stub_is_ee(value)
stub_is_ee_version(value)
stub_is_ee_env(value)
stub_is_package('ee', value)
# Auto-deploys can not be non-EE. So, stubbing it to false for CE builds.
# However, since not all EE builds need to be auto-deploys, stubbing it
# to true needs to be done in a case-by-case manner.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment