Sha256: d843ac8c0029bd8e5a38fe18eb77dd5ea6ed8e96669ad0a3f57f57866e6bc825

Contents?: true

Size: 1.42 KB

Versions: 6

Compression:

Stored size: 1.42 KB

Contents

Feature: Use the notifier in a plain Rack app

  Background:
    Given I have built and installed the "honeybadger" gem

  Scenario: Rescue and exception in a Rack app
    Given the following Rack app:
      """
      require 'rack'
      require 'honeybadger'

      Honeybadger.configure do |config|
        config.api_key = 'my_api_key'
      end

      app = Rack::Builder.app do
        use Honeybadger::Rack
        run lambda { |env| raise "Rack down" }
      end
      """
    When I perform a Rack request to "http://example.com:123/test/index?param=value"
    Then I should receive a Honeybadger notification

  Scenario: Ignore user agents
    Given the following Rack app:
      """
      require 'rack'
      require 'honeybadger'

      Honeybadger.configure do |config|
        config.api_key = 'my_api_key'
        config.ignore_user_agent << /ignore/
      end

      class Mock
        class AppendUserAgent
          def initialize(app)
            @app = app
          end

          def call(env)
            env["HTTP_USER_AGENT"] = "ignore"
            @app.call(env)
          end
        end
      end

      app = Rack::Builder.app do
        use Honeybadger::Rack
        use Mock::AppendUserAgent
        run lambda { |env| raise "Rack down" }
      end
      """
    When I perform a Rack request to "http://example.com:123/test/index?param=value"
    Then I should not see "** [Honeybadger] Response from Honeybadger:"

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
honeybadger-1.3.1 features/rack.feature
honeybadger-1.3.0 features/rack.feature
honeybadger-1.2.1 features/rack.feature
honeybadger-1.2.0 features/rack.feature
honeybadger-1.1.0 features/rack.feature
honeybadger-1.0.0 features/rack.feature