Sha256: 8c398a7f22ba5035eca10b3e256f61ba2416affddf7dfe01d698e6f93b051792
Contents?: true
Size: 594 Bytes
Versions: 78
Compression:
Stored size: 594 Bytes
Contents
# encoding: utf-8 require "logstash/instrument/metric_type/counter" require "spec_helper" describe LogStash::Instrument::MetricType::Counter do let(:namespaces) { [:root, :pipelines, :pipeline_01] } let(:key) { :mykey } subject { LogStash::Instrument::MetricType::Counter.new(namespaces, key) } describe "#increment" do it "increment the counter" do expect{ subject.increment }.to change { subject.value }.by(1) end end context "When serializing to JSON" do it "serializes the value" do expect(LogStash::Json.dump(subject)).to eq("0") end end end
Version data entries
78 entries across 78 versions & 1 rubygems