summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-01-26 00:04:09 +0000
committerRobert Speicher <rspeicher@gmail.com>2016-01-25 16:10:20 -0800
commit6881ba0e796fe22dd1d47bd1a7d42e532f18077a (patch)
tree654a99b8493c544fff34f6a52d2d6fa2b532b5e9 /spec
parent65d85a4403f6e5899f793acb53c64d7ad5ba7fdd (diff)
downloadgitlab-ce-6881ba0e796fe22dd1d47bd1a7d42e532f18077a.tar.gz
Merge branch 'instrumentation-signature' into 'master'
Correct arity for instrumented methods w/o args This should fix the problem of imports not working. See https://gitlab.com/gitlab-org/gitlab-ce/issues/12450#note_3380730 for the details/context of these changes. See merge request !2602
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/metrics/instrumentation_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/gitlab/metrics/instrumentation_spec.rb b/spec/lib/gitlab/metrics/instrumentation_spec.rb
index 2a37cd40dde..ad4290c43bb 100644
--- a/spec/lib/gitlab/metrics/instrumentation_spec.rb
+++ b/spec/lib/gitlab/metrics/instrumentation_spec.rb
@@ -66,6 +66,16 @@ describe Gitlab::Metrics::Instrumentation do
@dummy.foo
end
+
+ it 'generates a method with the correct arity when using methods without arguments' do
+ dummy = Class.new do
+ def self.test; end
+ end
+
+ described_class.instrument_method(dummy, :test)
+
+ expect(dummy.method(:test).arity).to eq(0)
+ end
end
describe 'with metrics disabled' do