October 2006
Intermediate to advanced
888 pages
16h 55m
English
Ryan Davis is the author of this excellent suite of tools. The main tool itself (zentest) is an executable that actually reads your code and produces a file of tests.
The class under test (CUT) is used as the basis for the test class (TC). The string Test is appended to the front of the class name at each scope level; the methods are named by appending test_ to the front of each name. Method names may also need to be “mangled” if they are methods such as == (which can’t have anything prefixed) or if they end in ?, !, or =.
Listing 16.2 shows a sample piece of code to be tested:
class Alpha class Beta attr_accessor :foo, :bar def initialize end def foo? @foo end end def initialize end def ... |
Read now
Unlock full access