summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2015-12-10 16:16:48 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2015-12-17 17:25:48 +0100
commitf43f3b89a633b5ceee4e71acba0c83ed5cb28963 (patch)
tree7152d5385d3ac57eb69cd80547cbe7e6bdac691a /spec
parent5dbcb635a17aff6543150a66b597c75b819801e2 (diff)
downloadgitlab-ce-f43f3b89a633b5ceee4e71acba0c83ed5cb28963.tar.gz
Added Instrumentation.configure
This makes it easier to instrument multiple modules without having to type the full namespace over and over again.
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/metrics/instrumentation_spec.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/lib/gitlab/metrics/instrumentation_spec.rb b/spec/lib/gitlab/metrics/instrumentation_spec.rb
index 5427bacdc94..fdb0820b875 100644
--- a/spec/lib/gitlab/metrics/instrumentation_spec.rb
+++ b/spec/lib/gitlab/metrics/instrumentation_spec.rb
@@ -17,12 +17,20 @@ describe Gitlab::Metrics::Instrumentation do
allow(@dummy).to receive(:name).and_return('Dummy')
end
+ describe '.configure' do
+ it 'yields self' do
+ described_class.configure do |c|
+ expect(c).to eq(described_class)
+ end
+ end
+ end
+
describe '.instrument_method' do
describe 'with metrics enabled' do
before do
allow(Gitlab::Metrics).to receive(:enabled?).and_return(true)
- Gitlab::Metrics::Instrumentation.instrument_method(@dummy, :foo)
+ described_class.instrument_method(@dummy, :foo)
end
it 'renames the original method' do