Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
executable file 70 lines (51 sloc) 2.18 KB
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/
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)
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/
gsinclair at gmail dot com
Jump to Line
Something went wrong with that request. Please try again.