Sha256: acd54b75d388ce940be9487a7d359e26c29132f6cf43ba469e39f16a8f887cb9

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

Feature: NagiosPlugin Usage

  In order to write Nagios Plugins with Ruby
  As a busy (developer|sysadmin|devop|hacker|superhero|rockstar)
  I want to use the one Nagios Plugin framework.

  Scenario Outline: Subclass from NagiosPlugin
    Given a file named "check_chunky_bacon.rb" with:
      """
      require 'nagiosplugin'

      class ChunkyBacon < Nagios::Plugin
        def critical?
          <critical>
        end

        def warning?
          <warning>
        end

        def ok?
          <ok>
        end

        def message
          42
        end
      end

      ChunkyBacon.run!
      """
    When I run `ruby check_chunky_bacon.rb`
    Then the exit status should be <es>
    And the stdout should contain exactly:
      """
      <stdout>

      """

    Examples:
     | critical | warning | ok    | status   | es | stdout                   |
     | true     | true    | true  | CRITICAL | 2  | CHUNKYBACON CRITICAL: 42 |
     | false    | true    | true  | WARNING  | 1  | CHUNKYBACON WARNING: 42  |
     | false    | false   | true  | OK       | 0  | CHUNKYBACON OK: 42       |
     | false    | false   | false | UNKNOWN  | 3  | CHUNKYBACON UNKNOWN: 42  |

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nagiosplugin-3.0.2 features/nagiosplugin_usage.feature
nagiosplugin-3.0.1 features/nagiosplugin_usage.feature
nagiosplugin-3.0.0 features/nagiosplugin_usage.feature