Sha256: bac8ed858aa9c3d011cd2a88af57b2a5a64ee01e29837734dc1324a3c187c0c5

Contents?: true

Size: 620 Bytes

Versions: 26

Compression:

Stored size: 620 Bytes

Contents

require 'test_helper'

class HelpersTest < Minitest::Test
  def setup
    test_class = Class.new(Minitest::Test)
    test_class.send(:include, StatsD::Instrument::Helpers)
    @test_case = test_class.new('fake')
  end

  def test_capture_metrics_inside_block_only
    StatsD.increment('counter')
    metrics = @test_case.capture_statsd_calls do
      StatsD.increment('counter')
      StatsD.gauge('gauge', 12)
    end
    StatsD.gauge('gauge', 15)

    assert_equal 2, metrics.length
    assert_equal 'counter', metrics[0].name
    assert_equal 'gauge', metrics[1].name
    assert_equal 12, metrics[1].value
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

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