Sha256: df18198fea168621bdc8e5a42fbac0b047195d64d291a5d780df54ffbaa23cf8

Contents?: true

Size: 1.14 KB

Versions: 29

Compression:

Stored size: 1.14 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'test_helper'))
class NewRelic::Agent::SamplerTest < Test::Unit::TestCase
  require 'new_relic/agent/sampler'

  def test_inherited_should_append_subclasses_to_sampler_classes
    test_class = Class.new(NewRelic::Agent::Sampler)
    sampler_classes = NewRelic::Agent::Sampler.instance_eval { @sampler_classes }
    assert(sampler_classes.include?(test_class), "Sampler classes (#{@sampler_classes.inspect}) does not include #{test_class.inspect}")
    # cleanup the sampler created above
    NewRelic::Agent::Sampler.instance_eval { @sampler_classes.delete(test_class) }
  end

  def test_sampler_classes_should_be_an_array
    sampler_classes = NewRelic::Agent::Sampler.instance_variable_get('@sampler_classes')
    assert(sampler_classes.is_a?(Array), 'Sampler classes should be saved as an array')
    assert(sampler_classes.include?(NewRelic::Agent::Samplers::CpuSampler), 'Sampler classes should include the CPU sampler')
  end

end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
newrelic_rpm-3.7.1.188 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.7.1.182 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.7.1.180 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.7.0.177 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.7.0.174.beta test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.9.171 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.8.168 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.8.164 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.7.159 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.7.159.beta test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.7.152 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.6.147 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.5.130 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.4.122 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.4.113.beta test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.3.111 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.3.106 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.3.105.beta test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.3.104 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.6.3.103.beta test/new_relic/agent/sampler_test.rb