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>2020-04-07 09:09:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-07 09:09:25 +0300
commit3d064c737e8448880e6180aeddc59000a01aa6a8 (patch)
treec97dcfe02e48426f96865068ffe8dcdd17bb1a96 /spec/lib/gitlab/usage_data_spec.rb
parent7ba5b9babaa5802c39e686c57cbf4a3f4725c4b0 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/usage_data_spec.rb')
-rw-r--r--spec/lib/gitlab/usage_data_spec.rb14
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