diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-07 06:09:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-07 06:09:25 +0000 |
commit | 3d064c737e8448880e6180aeddc59000a01aa6a8 (patch) | |
tree | c97dcfe02e48426f96865068ffe8dcdd17bb1a96 /spec/lib/gitlab | |
parent | 7ba5b9babaa5802c39e686c57cbf4a3f4725c4b0 (diff) | |
download | gitlab-ce-3d064c737e8448880e6180aeddc59000a01aa6a8.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/usage_data_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/usage_data_spec.rb b/spec/lib/gitlab/usage_data_spec.rb index c29a4dd9e00..37d9c5389dd 100644 --- a/spec/lib/gitlab/usage_data_spec.rb +++ b/spec/lib/gitlab/usage_data_spec.rb @@ -269,4 +269,18 @@ describe Gitlab::UsageData, :aggregate_failures do it_behaves_like 'usage data execution' end + + describe '#alt_usage_data' do + it 'returns the fallback when it gets an error' do + expect(described_class.alt_usage_data { raise StandardError } ).to eq(-1) + end + + it 'returns the evaluated block when give' do + expect(described_class.alt_usage_data { Gitlab::CurrentSettings.uuid } ).to eq(Gitlab::CurrentSettings.uuid) + end + + it 'returns the value when given' do + expect(described_class.alt_usage_data(1)).to eq 1 + end + end end |