[ANN] Dfect 2.0.0 (2010-03-21)

                 Dfect 2.0.0 (2010-03-21)

            Assertion testing library for Ruby


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

Version 2.0.0 (2010-03-21)

This release adds the ability to insulate tests from each
other, share code between them, makes the order of parameters
consistent in the API, improves user interactivity, fixes
some bugs, and revises the user manual.

Incompatible changes

 * Root-level calls to the Dfect::D() method are
   [1]automatically insulated now.

 * The Dfect::E() methods now expects its optional message
   parameter to be the last parameter in the parameter list.

 * The Dfect::C() methods now expect their first parameter
   to be a symbol instead of the optional message to be
   shown in case of assertion failure.

 * The Dfect::R() has been renamed to Dfect::L(), which is a
   mnemonic for [2]Logging.

 * Shorten names of hash keys in the execution trace for
   brevity and rename :raise key in report statistics to

 * Only the most helpful subset of the failure details is
   shown before placing the user into a debugger because
   they can query the omitted information (on demand) inside
   the debugger.

 * The execution trace is only shown if all tests passed in

 * The :debug option is now set to Ruby's $DEBUG global by

New features

 * Print failures as they occur instead of waiting until the

 * Allow passing condition as argument to true/false
   assertions instead of requiring the condition to be
   passed as a code block, and also fall back to the binding
   of inner-most enclosing test or hook when debugging or
   constructing a failure report for an assertion that was
   not given a block.

   This allows you to reduce "line noise" in your tests:

    D "Lottery" do
      winning_ticket = rand()

      D "My chances of winning" do
        my_ticket = rand()
        F my_ticket == winning_ticket, "I won?!  Dream on."

 * Add [3]Dfect::S() methods for sharing code between tests.

 * Add [4]Dfect::D!() method to explicitly insulate a test
   from other tests, the top-level Ruby environment, and the
   code being tested.

 * Add Dfect::info() method which returns the details of the
   failure that is currently being debugged by the user.

 * Add instance variables to the :vars section of a failure

 * Add setup!() and teardown!() methods for before-all and
   after-all hooks in the dfect/unit emulation library.

 * Add test execution time to statistics hash (under the
   :time key).

Bug fixes

 * Do not print any output when :quiet option is active.

 * Allow passing multiple strings/objects to Dfect::D() like
   in RSpec.

 * Make before and after hook methods mixin-able like

 * Do not assume that Module#to_s is the same as


 * Upgrade to Inochi 2.0.0 for managing this project.

 * Make emulation libraries modify Dfect module instead of

 * Do not pollute the user's output with our Class#to_yaml

 * Remove "Motivation" section from user manual. It was too


  1. http://snk.tuxfamily.org/lib/dfect/#Insulation
  2. http://snk.tuxfamily.org/lib/dfect/#Logging
  3. http://snk.tuxfamily.org/lib/dfect/#Sharing
  4. http://snk.tuxfamily.org/lib/dfect/#Insulation

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs