Sha256: a823bfd36005e858984c385c5bde5cf62a51578919bd2e80889a482203dbbc0a

Contents?: true

Size: 1009 Bytes

Versions: 96

Compression:

Stored size: 1009 Bytes

Contents

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

96 entries across 96 versions & 5 rubygems

Version Path
newrelic_rpm-3.5.4.34 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.5.4.33 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.5.4.31.beta test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.5.4.29.beta test/new_relic/agent/sampler_test.rb
ghazel-newrelic_rpm-3.5.4 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.5.3.25 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.5.3.24 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.5.2.17 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.5.1.14 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.5.1.14.beta test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.5.1.beta1 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.5.0.1 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.5.1.alpha test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.5.0 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.4.2.1 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.4.2 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.4.2.beta1 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.4.1 test/new_relic/agent/sampler_test.rb
newrelic_rpm-3.4.1.beta1 test/new_relic/agent/sampler_test.rb
ghazel-newrelic_rpm-3.4.0.2 test/new_relic/agent/sampler_test.rb