diff options
author | Rémy Coutable <remy@rymai.me> | 2019-08-14 10:22:15 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-08-14 10:22:25 +0200 |
commit | d8f9890009365627591d27bb733a51eadcdcdbe6 (patch) | |
tree | 365cc175210186cb252b6803b144d49354c4425d /qa/spec | |
parent | 94cf543fe3909a0a12771765a85c3c596f318046 (diff) | |
download | gitlab-ce-d8f9890009365627591d27bb733a51eadcdcdbe6.tar.gz |
Reduce the CE/EE diff under qa/qa-reduce-ce-ee-diff-in-qa-folder
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'qa/spec')
-rw-r--r-- | qa/spec/resource/repository/push_spec.rb | 6 | ||||
-rw-r--r-- | qa/spec/runtime/env_spec.rb | 24 |
2 files changed, 29 insertions, 1 deletions
diff --git a/qa/spec/resource/repository/push_spec.rb b/qa/spec/resource/repository/push_spec.rb index bf3ebce0cfe..2f9e4958ae1 100644 --- a/qa/spec/resource/repository/push_spec.rb +++ b/qa/spec/resource/repository/push_spec.rb @@ -19,7 +19,11 @@ describe QA::Resource::Repository::Push do expect { subject.files = [] }.to raise_error(ArgumentError) end - it 'does not raise if files is an array' do + it 'raises an error if files is not an array of hashes with :name and :content keys' do + expect { subject.files = [{ foo: 'foo' }] }.to raise_error(ArgumentError) + end + + it 'does not raise if files is an array of hashes with :name and :content keys' do expect { subject.files = files }.not_to raise_error end end diff --git a/qa/spec/runtime/env_spec.rb b/qa/spec/runtime/env_spec.rb index caf96a213e1..340831aa06d 100644 --- a/qa/spec/runtime/env_spec.rb +++ b/qa/spec/runtime/env_spec.rb @@ -192,6 +192,30 @@ describe QA::Runtime::Env do end end + describe '.knapsack?' do + it 'returns true if KNAPSACK_GENERATE_REPORT is defined' do + stub_env('KNAPSACK_GENERATE_REPORT', 'true') + + expect(described_class.knapsack?).to be_truthy + end + + it 'returns true if KNAPSACK_REPORT_PATH is defined' do + stub_env('KNAPSACK_REPORT_PATH', '/a/path') + + expect(described_class.knapsack?).to be_truthy + end + + it 'returns true if KNAPSACK_TEST_FILE_PATTERN is defined' do + stub_env('KNAPSACK_TEST_FILE_PATTERN', '/a/**/pattern') + + expect(described_class.knapsack?).to be_truthy + end + + it 'returns false if neither KNAPSACK_GENERATE_REPORT nor KNAPSACK_REPORT_PATH nor KNAPSACK_TEST_FILE_PATTERN are defined' do + expect(described_class.knapsack?).to be_falsey + end + end + describe '.require_github_access_token!' do it 'raises ArgumentError if GITHUB_ACCESS_TOKEN is not defined' do stub_env('GITHUB_ACCESS_TOKEN', nil) |