Ruby rspec-nagios-formatter Gem

Build Status

Description

This gem provides a simple RSpec custom formatter that reports rspec results in the Nagios/Icigna plugin output format.

Install

requirements

rake is required for the install process. It can be installed running:

gem install rake

via rubygems

gem install rspec-nagios-formatter

from git repo

bundle install
bundle exec rake install

Usage

The formatter may be used by either passing the -f|--format flag to rspec or with the included check_rspec script. The later sets the appropriate exit status for a failing Nagios/Icinga plugin.

check_rspec

Usage: check_rspec [options] [--] [passed to rspec]

Specific options:
    -t, --timeout TIMEOUT            default: 30.0 (seconds)
    -h, --help                       Show this message

Any options to check_rspec not prefixed with - or -- are passed directly on to the rspec utility. If you need to pass an option flag you may terminated check_rspec's option parsing with a bare --.

check_rspec -- -e 'foo' trivial_spec.rb

rspec

rspec -f RSpec::Nagios::Formatter

See the documentation on rspec --format for more information.

Demo

Demonstration of running this gem's rspec tests with it's own formatter (after it's been installed).

Default RSpec formatter

$ bundle exec rspec
.......

Finished in 0.00268 seconds
7 examples, 0 failures

Formatted with RSpec::Nagios::Formatter

$  bundle exec rspec -f RSpec::Nagios::Formatter
RSPEC OK - 7 examples, 0 failures, finished in 0.00244 seconds | examples=7 passing=7 failures=0 pending=0 conformance=100% time=0.00244s

Support

Please log tickets and issues at github

See Also

Bitdeli Badge