Sha256: c8ee2ec75eb70101c48eec346e565e15015848af10eceff6f659faf974c4e5ae

Contents?: true

Size: 951 Bytes

Versions: 10

Compression:

Stored size: 951 Bytes

Contents

require File.dirname(__FILE__) + "/../lib/toadhopper"

require 'test/unit'

class Toadhopper::TestNoticeParams < Test::Unit::TestCase
  def test_notice_params
    Toadhopper.api_key = "abc123"
    error = begin; raise "Kaboom!"; rescue => e; e end
    def error.backtrace; ["backtrace line 1", "backtrace line 2"] end
    assert_equal({
      "api_key"       => "abc123",
      "error_class"   => "RuntimeError",
      "error_message" => "Kaboom!",
      "backtrace"     => ["backtrace line 1", "backtrace line 2"],
      "request"       => {"request_var" => "request_val"},
      "environment"   => {"env_var" => "env_val"},
      "session"       => {"session_var" => "session_val"},
      },
      Toadhopper.notice_params(
        error,
        {
          "request" => {"request_var" => "request_val"},
          "environment" => {"env_var" => "env_val"},
          "session" => {"session_var" => "session_val"}
        }
      )
    )
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
toolmantim-toadhopper-0.2 test/test_notice_params.rb
toolmantim-toadhopper-0.3 test/test_notice_params.rb
toolmantim-toadhopper-0.4 test/test_notice_params.rb
toolmantim-toadhopper-0.5 test/test_notice_params.rb
toolmantim-toadhopper-0.6 test/test_notice_params.rb
toadhopper-0.7 test/test_notice_params.rb
toadhopper-0.6 test/test_notice_params.rb
toadhopper-0.5 test/test_notice_params.rb
toadhopper-0.4 test/test_notice_params.rb
toadhopper-0.3 test/test_notice_params.rb