Sha256: cab12d4356ddb38d130797dd1c03330f9435dc6eeb93c823826c3900fdced6e6

Contents?: true

Size: 1.76 KB

Versions: 15

Compression:

Stored size: 1.76 KB

Contents

Feature: Use the notifier in a plain Ruby app
  Scenario: Rescue and exception in a Rack app
    Given the following Ruby app:
      """
      require 'honeybadger'

      Honeybadger.configure do |config|
        config.api_key = 'my_api_key'
        config.logger = Logger.new STDOUT
      end

      begin
        fail 'oops!'
      rescue => e
        Honeybadger.notify(e)
      end
      """
    When I execute the file
    Then I should receive a Honeybadger notification

  Scenario: Dependency injection
    Given the following Ruby app:
      """
      require 'honeybadger/dependency'

      Honeybadger::Dependency.register do
        injection { puts 'injected' }
      end

      require 'honeybadger'

      Honeybadger.configure do |config|
        config.api_key = 'my_api_key'
        config.logger = Logger.new STDOUT
      end

      begin
        fail 'oops!'
      rescue => e
        Honeybadger.notify(e)
      end
      """
    When I execute the file
    Then the output should contain "injected"
    And I should receive a Honeybadger notification

  # TODO: also test 'Then the output should contain "injection failure"' after default
  # logging is added.
  Scenario: Dependency injection exception
    Given the following Ruby app:
      """
      require 'honeybadger/dependency'

      Honeybadger::Dependency.register do
        injection { fail 'injection failure' }
      end

      require 'honeybadger'

      Honeybadger.configure do |config|
        config.api_key = 'my_api_key'
        config.logger = Logger.new STDOUT
      end

      begin
        fail 'oops!'
      rescue => e
        Honeybadger.notify(e)
      end
      """
    When I execute the file
    Then the output should not contain "injected"
    And I should receive a Honeybadger notification

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
honeybadger-1.16.7 features/standalone.feature
honeybadger-1.16.6 features/standalone.feature
honeybadger-1.16.5 features/standalone.feature
honeybadger-1.16.4 features/standalone.feature
honeybadger-1.16.3 features/standalone.feature
honeybadger-1.16.2 features/standalone.feature
honeybadger-1.16.1 features/standalone.feature
honeybadger-1.16.0 features/standalone.feature
honeybadger-1.15.3 features/standalone.feature
honeybadger-1.15.2 features/standalone.feature
honeybadger-1.15.1 features/standalone.feature
honeybadger-1.15.0 features/standalone.feature
honeybadger-1.14.0 features/standalone.feature
honeybadger-1.12.0.beta3 features/standalone.feature
honeybadger-1.12.0.beta2 features/standalone.feature