forked from sunaku/detest
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
executable file
·69 lines (51 loc) · 2.18 KB
/
README
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
gsinclair/dfect
===============
Fork by Gavin Sinclair of Suraj N. Kurapati's 'dfect' testing library.
Things I like about dfect: simplicity, minimalism, good design.
Things I want to implement, with progress reports:
* Minimal but useful output with meaningful failure messages
- Completed in most/all cases; see below.
- When asserting equality between two long strings, the _difference_
between them is indicated for easier debugging.
* Colourful output
- Completed in most/all cases.
* (A few) more assertions, like Eq for asserting equality
- The following are implemented (test/unit equivalent in brackets):
+ Eq (assert_equal)
+ N (assert_nil)
+ Mt (assert_match)
- More to come as I need/want them. Not aiming to add everything
under the sun, though!
* Facility for user-added assertions
- No work done on this.
* Easily select the tests you want to run
- No work done on this.
* Easily run the debugger when certain tests are executing
- The global variable $dfect_test is set to the description of the
currently-running test, meaning you can insert a line into your
code like this:
debugger if $dfect_test =~ /generate HTML/
Output
------
Here is a "screenshot" of a test failure in the project I'm working on.
Unfortunately it doesn't show the colour, which makes it much easier to read.
See links [1]-[3] below for true screenshots showing the colour.
FAIL: TopicDocument (resources)
./test/topic_document.rb
53 Eq r[0].category, "F"
54 Eq r[0].filetype, "PDF"
=> 55 Eq r[0].file_re, /^A030.+worksheet/
56 Eq r[0].description, %{
57 A summary of (nearly?) all the skills taught in this topic.
Equality test failed
Was: /^A030.+worksheet.pdf/
Exp: /^A030.+worksheet/
Backtrace
./test/topic_document.rb:55
test/_all.rb:19
[1] http://picasaweb.google.com/lh/photo/WyrF7D7I4sKnSNCz0RlBJw
[2] http://picasaweb.google.com/lh/photo/N8kCnZ3U3wFqKBKKJM9Crg
[3] http://picasaweb.google.com/lh/photo/7r2o1HWCjyEOhjc7o1nluQ
Contact
-------
gsinclair at gmail dot com