diff options
Diffstat (limited to 'spec/lib/gitlab/cache/metrics_spec.rb')
-rw-r--r-- | spec/lib/gitlab/cache/metrics_spec.rb | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/spec/lib/gitlab/cache/metrics_spec.rb b/spec/lib/gitlab/cache/metrics_spec.rb index d8103837708..24b274f4209 100644 --- a/spec/lib/gitlab/cache/metrics_spec.rb +++ b/spec/lib/gitlab/cache/metrics_spec.rb @@ -3,8 +3,10 @@ require 'spec_helper' RSpec.describe Gitlab::Cache::Metrics do - subject(:metrics) do - described_class.new( + subject(:metrics) { described_class.new(metadata) } + + let(:metadata) do + Gitlab::Cache::Metadata.new( caller_id: caller_id, cache_identifier: cache_identifier, feature_category: feature_category, @@ -27,24 +29,6 @@ RSpec.describe Gitlab::Cache::Metrics do ).and_return(counter_mock) end - describe '#initialize' do - context 'when backing resource is not supported' do - let(:backing_resource) { 'foo' } - - it { expect { metrics }.to raise_error(RuntimeError) } - - context 'when on production' do - before do - allow(Gitlab).to receive(:dev_or_test_env?).and_return(false) - end - - it 'does not raise an exception' do - expect { metrics }.not_to raise_error - end - end - end - end - describe '#increment_cache_hit' do subject { metrics.increment_cache_hit } |