# \[ANN\] Dfect 0.1.0

**URL:** <https://www.ruby-forum.com/t/ann-dfect-0-1-0/166750>\
**Category:** Ruby\
**Created:** [April 29, 2009, 7:22am UTC](https://www.ruby-forum.com/t/ann-dfect-0-1-0/166750 "2009-04-29T07:22:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d9b06d/32.png) [@snk](https://www.ruby-forum.com/u/snk)\
**Post date:** [April 29, 2009, 7:22am UTC](https://www.ruby-forum.com/t/ann-dfect-0-1-0/166750/1 "2009-04-29T07:22:58Z")

</div>

```
                        Dfect 0.1.0

            Assertion testing library for Ruby

            http://snk.tuxfamily.org/lib/dfect

```

Dfect is an assertion testing library for Ruby that  
emphasizes a simple assertion vocabulary, instant  
debuggability of failures, and flexibility in composing  
tests.

Dfect is exciting because:

```
 * It has only 5 methods to remember: D F E C T.

 * It lets you debug assertion failures interactively.

 * It keeps a detailed report of assertion failures.

 * It lets you nest tests and execution hooks.

 * It is implemented in a mere 313 lines of code.

```

Version 0.1.0 (2009-04-28)

This release adds new variations to assertion methods, fixes  
several bugs, and improves test coverage.

Thank you

```
 * FranÃ§ois Beausoleil contributed patches for both code
   and tests! :-)

```

New features

```
 * Added [1]negation (m!) and [2]sampling (m?) variations to
   [3]assertion methods.
   These new methods implement assertion functionality
   missing so far (previously we could not assert that a
   given exception was NOT thrown) and thereby allow us to
   fully test Dfect using itself.

 * Added documentation on [4]how to insulate tests from the
   global Ruby namespace.

```

Bug fixes

```
 * The E() method did not consider the case where a block
   does not raise anything as a failure. --FranÃ§ois
   Beausoleil

 * When creating a report about an assertion failure, an
   exception would be thrown if any local variables pointed
   to an empty array.

 * The Dfect::<() method broke the inheritance-checking
   behavior of the < class method.
   Added a bypass to the originial behavior so that RCov::XX
   can properly generate a report about code that uses
   Dfect.

 * Added workaround for YAML error when serializing a class
   object:

```

TypeError: can’t dump anonymous class Class

Housekeeping

```
 * Filled the big holes in test coverage. Everything except
   the runtime debugging logic is now covered by the unit
   tests.

```

References

1. [detest(1)](http://snk.tuxfamily.org/lib/dfect/#Negation)
2. [detest(1)](http://snk.tuxfamily.org/lib/dfect/#Sampling)
3. [detest(1)](http://snk.tuxfamily.org/lib/dfect/#Assertions)
4. [detest(1)](http://snk.tuxfamily.org/lib/dfect/#Insulation)
