public
Description: A micro test "framework"
Homepage: http://yapok.org/blog/
Clone URL: git://github.com/madx/mtest.git
mtest /
name age message
file .gitignore Fri May 30 05:35:43 -0700 2008 Quick fixes, should be ok now [madx]
file README Thu Jun 05 08:46:11 -0700 2008 README: misc adds [madx]
file Rakefile Thu Jun 26 04:20:17 -0700 2008 Applying fixes for github gem generation [madx]
file VERSION Thu Jun 05 23:52:41 -0700 2008 mtest.rb: remove $VERBOSE flag, always put exce... [madx]
directory hacks/ Loading commit data...
directory lib/
file mtest.gemspec Thu Jun 26 04:20:17 -0700 2008 Applying fixes for github gem generation [madx]
README
    ‘‘ MTest ’’


MTest (stands for MicroTest) is a tiny and fast TDD framework.

It provides the Kernel#MTest method that takes an array of test as a parameter.

Need an example? Right.


  require 'mtest'
  
  tests = [
    "This is a simple test",
    ["Sum 40+2", proc {
      40 + 2
    }, 42]
  ]
  
  MTest(tests)

  
MTests returns a hash that represents the results of a test. Example!


  tests = [
    "This is a simple test",
    ["Sum 40+2", proc { 40 + 2 }, 42],
    
    "This one fails",
    ["FAIL", proc { true }, false]
  ]
  
  res = MTest(tests)
  
  res # => {:pass => 1, :err => 0, :fail => 1}
  
  
** Contributing **

Everyone is welcome to contribute to MTest. The only restriction is that
mtest.rb must be less than 51 lines long.

But feel free to submit your own tools, examples, hacks, etc.