cucumber-nagios lets you describe how a system should work in natural language, and outputs whether it does in the Nagios plugin format:

Feature: google.com
  It should be up
  And I should be able to search for things

  Scenario: Searching for things
    When I go to "http://www.google.com.au/"
    And I fill in "q" with "wikipedia"
    And I press "Google Search"
    Then I should see "www.wikipedia.org"
  

Then run it:

$ cucumber-nagios google.feature
CUCUMBER OK - Critical: 0, Warning: 0, 4 okay
  

cucumber-nagios uses Webrat with the Mechanize backend, so you can point it any site you can reach over HTTP (you don't have to have access to the site's code). 

cucumber-nagios can also interact with machines over SSH through Net::SSH, bringing you closer to Behaviour Driven Infrastructure nirvana.

Installing

cucumber-nagios is distributed as a RubyGem.

$ gem install cucumber-nagios
  

Then you just set up a project to contain all your descriptions.

$ cucumber-nagios-gen project ebay.com.au
$ cd ebay.com.au
$ bundle install
  

bundle install freezes in RubyGem dependencies with Bundler, so you can tar up your cucumber-nagios project and put it on another machine easily.

Windows users: you need to download and install the Ruby Installer and the development kit, otherwise gem install cucumber-nagios will fail.

Using

cucumber-nagios includes a generator that can spit out features. From within your project directory:

$ cucumber-nagios-gen feature ebay.com.au bidding
  

ebay.com.au being the site you want to test, and bidding the feature you want to test.

Write your features in your favourite editor (the above generated feature will live in features/ebay.com.au/bidding.feature), then test it with:

$ bin/cucumber-nagios features/ebay.com.au/bidding.feature
CUCUMBER OK - Critical: 0, Warning: 0, 4 okay
  

Meta

Related

Friends