use public_send where appropriate

This commit is contained in:
Pawel Chojnacki 2018-01-22 20:53:14 +01:00
parent 75b49298f7
commit 2b5a639d79

View file

@ -35,19 +35,19 @@ describe Gitlab::Metrics::Concern do
it 'calls fetch_metric' do
expect(subject).to receive(:init_metric).with(metric_type, metric_name, docstring: docstring)
subject.send(metric_name)
subject.public_send(metric_name)
end
end
context 'metric is cached' do
before do
subject.send(metric_name)
subject.public_send(metric_name)
end
it 'returns cached metric' do
expect(subject).not_to receive(:init_metric)
subject.send(metric_name)
subject.public_send(metric_name)
end
end
end