Sha256: 2dfc496e6b8d182b48401ad3eb2ec4ea2bc2a3b43992217a21ee8ff778fb7b6f

Contents?: true

Size: 765 Bytes

Versions: 36

Compression:

Stored size: 765 Bytes

Contents

require 'test_helper'

class CaptureBackendTest < Minitest::Test
  def setup
    @backend = StatsD::Instrument::Backends::CaptureBackend.new
    @metric1 = StatsD::Instrument::Metric::new(type: :c, name: 'mock.counter')
    @metric2 = StatsD::Instrument::Metric::new(type: :ms, name: 'mock.measure', value: 123)
  end

  def test_collecting_metric
    assert @backend.collected_metrics.empty?
    @backend.collect_metric(@metric1)
    @backend.collect_metric(@metric2)
    assert_equal [@metric1, @metric2], @backend.collected_metrics
  end

  def test_reset
    @backend.collect_metric(@metric1)
    @backend.reset
    assert @backend.collected_metrics.empty?
    @backend.collect_metric(@metric2)
    assert_equal [@metric2], @backend.collected_metrics
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
qubole-statsd-instrument-2.1.6 test/capture_backend_test.rb
statsd-instrument-2.3.5 test/capture_backend_test.rb
statsd-instrument-2.3.4 test/capture_backend_test.rb
qubole-statsd-instrument-2.1.5 test/capture_backend_test.rb
statsd-instrument-2.3.2 test/capture_backend_test.rb
statsd-instrument-2.3.1 test/capture_backend_test.rb
qubole-statsd-instrument-2.1.4 test/capture_backend_test.rb
statsd-instrument-2.3.0 test/capture_backend_test.rb
statsd-instrument-2.3.0.beta6 test/capture_backend_test.rb
statsd-instrument-2.3.0.beta5 test/capture_backend_test.rb
statsd-instrument-2.3.0.beta4 test/capture_backend_test.rb
statsd-instrument-2.3.0.beta3 test/capture_backend_test.rb
statsd-instrument-2.3.0.beta2 test/capture_backend_test.rb
statsd-instrument-2.3.0.beta test/capture_backend_test.rb
statsd-instrument-2.2.1 test/capture_backend_test.rb
statsd-instrument-2.2.0 test/capture_backend_test.rb
statsd-instrument-2.1.4 test/capture_backend_test.rb
statsd-instrument-2.1.3 test/capture_backend_test.rb
statsd-instrument-2.1.2 test/capture_backend_test.rb
statsd-instrument-2.1.1 test/capture_backend_test.rb