diff --git a/spec/examples/metric_example.rb b/spec/examples/metric_example.rb index 4dca8c64..ced2c317 100644 --- a/spec/examples/metric_example.rb +++ b/spec/examples/metric_example.rb @@ -63,17 +63,5 @@ expect(subject.get(labels: { test: 'label' })).to be_a(type) end end - - context "with non-string label values" do - subject { described_class.new(:foo, docstring: 'Labels', labels: [:test]) } - - it "converts labels to strings for consistent storage" do - incrementor.call(test: :label) - expect(subject.get(labels: { test: 'label' })).to eq(1.0) - end - - context "and all labels preset" do - end - end end end diff --git a/spec/prometheus/client/counter_spec.rb b/spec/prometheus/client/counter_spec.rb index c3fee3d1..22997532 100644 --- a/spec/prometheus/client/counter_spec.rb +++ b/spec/prometheus/client/counter_spec.rb @@ -20,7 +20,6 @@ it_behaves_like Prometheus::Client::Metric do let(:type) { Float } - let(:incrementor) { ->(labels) { subject.increment(labels: labels); pp subject} } end describe '#increment' do @@ -79,5 +78,17 @@ end.each(&:join) end.to change { counter.get }.by(100.0) end + + context "with non-string label values" do + subject { described_class.new(:foo, docstring: 'Labels', labels: [:test]) } + + it "converts labels to strings for consistent storage" do + subject.increment(labels: {test: :label}) + expect(subject.get(labels: { test: 'label' })).to eq(1.0) + end + + context "and all labels preset" do + end + end end end