debian-mirror-gitlab/spec/initializers/8_metrics_spec.rb

23 lines
768 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'spec_helper'
2017-09-10 17:25:29 +05:30
describe 'instrument_classes' do
2017-08-17 22:00:37 +05:30
let(:config) { double(:config) }
2017-09-10 17:25:29 +05:30
let(:influx_sampler) { double(:influx_sampler) }
2017-08-17 22:00:37 +05:30
before do
allow(config).to receive(:instrument_method)
allow(config).to receive(:instrument_methods)
2017-09-10 17:25:29 +05:30
allow(config).to receive(:instrument_instance_method)
2017-08-17 22:00:37 +05:30
allow(config).to receive(:instrument_instance_methods)
2018-03-17 18:26:18 +05:30
allow(Gitlab::Metrics::Samplers::InfluxSampler).to receive(:initialize_instance).and_return(influx_sampler)
2017-09-10 17:25:29 +05:30
allow(influx_sampler).to receive(:start)
allow(Gitlab::Application).to receive(:configure)
2017-08-17 22:00:37 +05:30
end
it 'can autoload and instrument all files' do
2017-09-10 17:25:29 +05:30
require_relative '../../config/initializers/8_metrics'
2017-08-17 22:00:37 +05:30
expect { instrument_classes(config) }.not_to raise_error
end
end