Sha256: 9e0213cbd8d5475976e58c789e2da845ad5dc3afa343236f13b5ee7b3090ef2f

Contents?: true

Size: 1.15 KB

Versions: 5

Compression:

Stored size: 1.15 KB

Contents

Feature: NagiosPlugin Usage

  In order to write awesome Nagios Plugins with minimal effort
  As a busy (developer|sysadmin|devop|hacker|superhero|rockstar)
  I want to use the one NagiosPlugin framework

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

      class Foo < NagiosPlugin::Plugin
        def check
          case ARGV.first
            when 'UNKNOWN'  then unknown  'no clue, sorry'
            when 'CRITICAL' then critical 'booooom!'
            when 'WARNING'  then warning  'it could be worse'
            when 'OK'       then ok       'all is fine'
          end
        end
      end

      Foo.run
      """
    When I run `ruby check_foo.rb <status>`
    Then the exit status should be <code>
    And the stdout should contain exactly:
      """
      <stdout>

      """

    Examples:
     | status   | code | stdout                         |
     | UNKNOWN  | 3    | FOO UNKNOWN: no clue, sorry    |
     | CRITICAL | 2    | FOO CRITICAL: booooom!         |
     | WARNING  | 1    | FOO WARNING: it could be worse |
     | OK       | 0    | FOO OK: all is fine            |

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nagiosplugin-1.3.0 features/nagiosplugin_usage.feature
nagiosplugin-1.2.0 features/nagiosplugin_usage.feature
nagiosplugin-1.1.2 features/nagiosplugin_usage.feature
nagiosplugin-1.1.1 features/nagiosplugin_usage.feature
nagiosplugin-1.1.0 features/nagiosplugin_usage.feature