Sha256: f9391e8ae6400d0500248ee9a6e2d6bedcd8b5ebc0a0f150afe7c0edfcf446b9

Contents?: true

Size: 1.1 KB

Versions: 91

Compression:

Stored size: 1.1 KB

Contents

if defined?(::Roda)
  require 'test_helper'
  require File.expand_path(File.dirname(__FILE__) + '/../apps/roda')
  require 'rack/test'

  class RodaTest < Minitest::Test
    include Rack::Test::Methods

    def app
      InstanaRodaApp
    end

    def test_basic_get
      clear_all!

      r = get '/hello'
      assert last_response.ok?

      assert r.headers.key?("X-Instana-T")
      assert r.headers.key?("X-Instana-S")

      spans = ::Instana.processor.queued_spans
      assert_equal 1, spans.count

      first_span = spans.first
      assert_equal :rack, first_span[:n]
      assert first_span.key?(:data)
      assert first_span[:data].key?(:http)

      assert first_span[:data][:http].key?(:method)
      assert_equal "GET", first_span[:data][:http][:method]

      assert first_span[:data][:http].key?(:url)
      assert_equal "/hello", first_span[:data][:http][:url]

      assert first_span[:data][:http].key?(:status)
      assert_equal 200, first_span[:data][:http][:status]

      assert first_span[:data][:http].key?(:host)
      assert_equal "example.org", first_span[:data][:http][:host]
    end
  end
end

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
instana-1.11.8-java test/frameworks/roda_test.rb
instana-1.11.8 test/frameworks/roda_test.rb
instana-1.11.7 test/frameworks/roda_test.rb
instana-1.11.6 test/frameworks/roda_test.rb
instana-1.11.6-java test/frameworks/roda_test.rb
instana-1.11.5 test/frameworks/roda_test.rb
instana-1.11.5-java test/frameworks/roda_test.rb
instana-1.11.4-java test/frameworks/roda_test.rb
instana-1.11.4 test/frameworks/roda_test.rb
instana-1.11.3-java test/frameworks/roda_test.rb
instana-1.11.3 test/frameworks/roda_test.rb
instana-1.11.2-java test/frameworks/roda_test.rb
instana-1.11.2 test/frameworks/roda_test.rb
instana-1.11.1-java test/frameworks/roda_test.rb
instana-1.11.1 test/frameworks/roda_test.rb
instana-1.11.0-java test/frameworks/roda_test.rb
instana-1.11.0 test/frameworks/roda_test.rb
instana-1.10.10 test/frameworks/roda_test.rb
instana-1.10.10-java test/frameworks/roda_test.rb
instana-1.10.9-java test/frameworks/roda_test.rb