Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
When all you need is #assert
Ruby
tree: f320b11237

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
LICENSE
Manifest
README.rdoc
Rakefile
examples.rb
gem.watchr
specs.watchr

README.rdoc

Summary

Extremely mynymal test framework. Perfect for DIY lovers. NanoTest provides the bare mynymum needed; for everything else, there's ruby.

Install

gem install nanotest --source http://gemcutter.org

Examples

require 'nanotest'
include NanoTest

assert { 1 == 1 }
assert { 1 >= 1 }
assert { 1 == 2 } #line 12

outputs:

..F
(examples.rb:012) assertion failed

API

NanoTest has a single method: #assert. You can either include NanoTest as above, or use its method directly:

NanoTest.assert { true }

Its block is expected to return a boolean. If it's false (== false) it fails, otherwise it passes. Simple as that.

#assert also accepts a custom failure message (defaults to “assertion failed”):

assert("foo is too small") { @foo > 5 } #line 36
#=> (examples.rb:036) foo is too small

That's pretty much it. Maximum Simplicity. If you insist on doing something fancy, check out the wiki for a few tips and tricks.

Links

source

github.com/mynyml/nanotest

docs

rdoc.info/projects/mynyml/nanotest

wiki

wiki.github.com/mynyml/nanotest

bugs

github.com/mynyml/nanotest/issues

tl;dr: is small test fw. is fun. assert(“msg”) { bool }

Something went wrong with that request. Please try again.