Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Defensive programming with expectations
JavaScript Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
rdoc
tasks
test
.gitignore
Changelog.md
Gemfile
Gemfile.lock
LICENSE.BSD
README.md
Rakefile
expectation.gemspec

README.md

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.

Something went wrong with that request. Please try again.