Sha256: 32382fae6fa70fe89c297473d6ef3b911b1f57622e480fc9f2ae4ca7dd44d73b

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

=== 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 {     2  > 1 }
  assert { not 1  > 2 }
  assert {     1 == 2 } #line 12

outputs:

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

There's also a real life example at http://github.com/mynyml/phocus/blob/master/test/test_phocus.rb

=== 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 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.

=== Stats

  $ rake -s loc
  lib files contain 18 SLOCs

=== Links

source:: http://github.com/mynyml/nanotest
docs::   http://rdoc.info/projects/mynyml/nanotest
wiki::   http://wiki.github.com/mynyml/nanotest
bugs::   http://github.com/mynyml/nanotest/issues


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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nanotest-0.9.3 README.rdoc