0.01
Low commit activity in last 3 years
No release in over a year
Defensive programming with expectations
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Expect

Installation

gem install expectations

Presentation

A short presentation is hosted at Github.

Documentation

Documentation is available at rubydoc.info.

Getting started

This function expects a String argument starting with "http:", an Integer or Float argument, and a Hash with a String entry at key :foo, and either an Array or nil at key :bar.

def function(a, b, options = {})
  expect! a => /^http:/, 
          b => [Integer, Float], 
          options => {
            :foo => String,
            :bar => [ Array, nil ]
          }
end

License

The expectations gem is distributed under the terms of the Modified BSD License, see LICENSE.BSD for details.