PackageDescription: SUnitResourcePatterns
S Unit Resource PatternsLast published: May 7, 2010 by 'nross'
Defines 5 Classes
Extends 8 Classes
SUnit extensions and example patterns. See the test resource subclass comments for detailed descriptions.
- CompetingResource: when two or more resources cannot both be available at the same time and you wish to add tests using each to an overall suite.
- InvariantResource: when you want a run to leave the resource active if was active before the run started.
- SkipResource: when a SkipResource is unavailable, it raises a TestSkip before raising a failure; only if the test nevertheless proceeds (i.e. the skip is unhandled) does it then fail the test.
The protocol #assert:orSkip:, #deny:orSkip: can also be used directly in tests to replace code of the form:
self isOnMac ifFalse: [^self]. "test only makes sense on Mac OS"
with
self assert: self isOnMac orSkip: 'test only makes sense on Mac OS'.
Calling #addSkip: on a TestResult transforms it into a ClassifiedResult, to which further skips or other specialised results may be added.