public
Description: A micro test "framework"
Homepage: http://yapok.org/blog/
Clone URL: git://github.com/madx/mtest.git
mtest / README
100644 46 lines (25 sloc) 0.83 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
 
    ‘‘ 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.