Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Super simple Ruby testing library

tree: 780217c89b

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib Tightening things up, minor doc edits
Octocat-spinner-32 test Tightening things up, minor doc edits
Octocat-spinner-32 .gitignore Initial import
Octocat-spinner-32 .travis.yml traviscified!
Octocat-spinner-32 Gemfile Initial import
Octocat-spinner-32 Gemfile.travis traviscified!
Octocat-spinner-32 HISTORY Added HISTORY file
Octocat-spinner-32 LICENSE Tightening things up, minor doc edits
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile Tightening things up, minor doc edits
Octocat-spinner-32 testrocket.gemspec Tightening things up, minor doc edits
README.md
 _            _                  _         _   
| |_  ___ ___| |_ _ __ ___   ___| | __ ___| |_ 
| __|/ _ | __| __| '__/ _ \ / __| |/ // _ \ __|
| |_|  __|__ \ |_| | | (_) | (__|   <|  __/ |_ 
 \__|\___|___/\__|_|  \___/ \___|_|\_\\___|\__|

Testrocket is a super simple (as simple as it gets really) testing library for Ruby.

It was initially developed for a CodeBrawl contest and it won! People asked me to release it 'for real' so here we are.

To install:

gem install testrocket

As yet there are no useful bits and pieces for creating test files (look at the example, it's easy!) or Rake tasks. But it's all crazy simple. A few things may be added later on.

Dependencies

  • Ruby 1.9
  • minitest (part of MRI 1.9 stdlib)

Example

require 'testrocket'

# BASIC USAGE
# +-> { block that should succeed }
# --> { block that should fail }

+-> { Die.new(2) }
--> { raise }
+-> { 2 + 2 == 4 }

# These two tests will deliberately fail
+-> { raise }
--> { true }

# A 'pending' test
~-> { "this is a pending test" }

# A description
!-> { "use this for descriptive output and to separate your test parts" }

Other Features

By default, output is written to STDOUT (as well as returned by the test expressions themselves). You can override where test output goes like so:

TestRocket.out = File.new('/dev/null', 'w')

TestRocket.out also supports Logger instances.

Authors

Initial concept and maintenance by Peter Cooper Extra concepts and code by Christoph Grabo

Something went wrong with that request. Please try again.