Sha256: dbf1eef6856cc33c749b03e5a47b704c779073a04e7d5158caaada5ef8f3212a

Contents?: true

Size: 1.46 KB

Versions: 69

Compression:

Stored size: 1.46 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_helper'))

class NewRelic::Agent::Instrumentation::MetricFrameTest < Test::Unit::TestCase

  attr_reader :f
  def setup
    @f = NewRelic::Agent::Instrumentation::MetricFrame.new
  end

  def test_request_parsing__none
    assert_nil f.uri
    assert_nil f.referer
  end
  def test_request_parsing__path
    request = stub(:path => '/path?hello=bob#none')
    f.request = request
    assert_equal "/path", f.uri
  end
  def test_request_parsing__fullpath
    request = stub(:fullpath => '/path?hello=bob#none')
    f.request = request
    assert_equal "/path", f.uri
  end
  def test_request_parsing__referer
    request = stub(:referer => 'https://www.yahoo.com:8080/path/hello?bob=none&foo=bar')
    f.request = request
    assert_nil f.uri
    assert_equal "https://www.yahoo.com:8080/path/hello", f.referer
  end

  def test_request_parsing__uri
    request = stub(:uri => 'http://creature.com/path?hello=bob#none', :referer => '/path/hello?bob=none&foo=bar')
    f.request = request
    assert_equal "/path", f.uri
    assert_equal "/path/hello", f.referer
  end

  def test_request_parsing__hostname_only
    request = stub(:uri => 'http://creature.com')
    f.request = request
    assert_equal "/", f.uri
    assert_nil f.referer
  end
  def test_request_parsing__slash
    request = stub(:uri => 'http://creature.com/')
    f.request = request
    assert_equal "/", f.uri
    assert_nil f.referer
  end
end

Version data entries

69 entries across 69 versions & 4 rubygems

Version Path
newrelic_rpm-3.5.0.1 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.1.alpha test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.5.0 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.4.2.1 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.4.2 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.4.2.beta1 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.4.1 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.4.1.beta1 test/new_relic/agent/instrumentation/metric_frame_test.rb
ghazel-newrelic_rpm-3.4.0.2 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.4.0.1 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.4.0 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.4.0.beta2 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.3.5 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.3.5.beta1 test/new_relic/agent/instrumentation/metric_frame_test.rb
newrelic_rpm-3.4.0.beta1 test/new_relic/agent/instrumentation/metric_frame_test.rb
dolores_rpm-3.3.4.8 test/new_relic/agent/instrumentation/metric_frame_test.rb
dolores_rpm-3.3.4.7 test/new_relic/agent/instrumentation/metric_frame_test.rb
dolores_rpm-3.3.4.6 test/new_relic/agent/instrumentation/metric_frame_test.rb
dolores_rpm-3.3.4.5 test/new_relic/agent/instrumentation/metric_frame_test.rb
dolores_rpm-3.3.4.4 test/new_relic/agent/instrumentation/metric_frame_test.rb