diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-07 15:10:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-07 15:10:27 +0300 |
commit | 53f456b167f19877d663ee6ed510673cebee0f91 (patch) | |
tree | fcc0bb52b79c195bf0eda100cc5d7e7a16dc0c0b /spec/support/gitlab | |
parent | e8a31d8dc2afd673ca50d74d26edab0a0fec83ca (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/gitlab')
-rw-r--r-- | spec/support/gitlab/usage/metrics_instrumentation_shared_examples.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/gitlab/usage/metrics_instrumentation_shared_examples.rb b/spec/support/gitlab/usage/metrics_instrumentation_shared_examples.rb new file mode 100644 index 00000000000..c9ff566e94c --- /dev/null +++ b/spec/support/gitlab/usage/metrics_instrumentation_shared_examples.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'a correct instrumented metric value' do |options, expected_value| + let(:time_frame) { options[:time_frame] } + + before do + allow(ActiveRecord::Base.connection).to receive(:transaction_open?).and_return(false) + end + + it 'has correct value' do + expect(described_class.new(time_frame: time_frame).value).to eq(expected_value) + end +end |