https://github.com/schwern/test-more/tree/v2.00_06
Apparently the way you make me write code is send me to a Linux conference.

This is the sixth alpha release of Test::Builder2 and it is a big one.  Maybe
not in lines of code, but in concepts.

The major bits are:

The Design Is Working
---------------------

The biggest thing bout this release is that it's all coming together.

The event design is solving old problems and neatly handling new ones.  This
is an excellent indication of TB2's future flexibility.
Test::Builder2::Tester was almost trivial.  Test::Builder is getting simpler
as more of its state handling and logic is pushed down into events.  The
number of issues in the tracker is for the first time falling.  Slightly.


Stable Is In Sight!
-------------------

...through a telescope.  But it's a ground based one!

I've gone through the issues and tagged everything blocking a stable release.
https://github.com/schwern/test-more/issues/labels/Blocking%20Stable

I've created a meta-issue listing the requirements for a stable release.
https://github.com/schwern/test-more/issues/issue/127

    * There are no publicly visible bad ideas in Test::Builder2
    * Test::More is using Test::Builder2 (complex use case)
          o Demonstrates TB2 and TB1 working together
    * DONE All the Test::Builder stuff still works
    * DONE A formatter independent Test:: tester is available
    * Use cases demonstrations
          o DONE Die/debug on fail (result hooks)
          o Test::Warn/Exception (nested, but independent, asserts)
          o DONE Test::NoWarnings (event hooks)
    * CPAN works
          o Except the modules that do evil things to Test::Builder
                + Unless they're really important
                      # In which case we'll ensure they're updated for TB2


Test::Builder will work with a non TAP formatter
------------------------------------------------

This was a big blocker to letting all the existing Test:: modules play with
Test::Builder2.

In previous alpha releases, Test::Builder needed to call special methods on
the TAP formatter to preserve existing features.  Now a lot of that
functionality has either been moved into the History (where it belongs so
everybody has it) or TB1 makes them optional (ie. calls them in an eval).


Test::Builder delegates plan state to History
---------------------------------------------

This was another blocker to letting existing Test:: modules play with TB2.

Test::Builder was designed as a monolith.  It would track things like details
of the plan, if the plan had been set, etc.  In TB2, things other than
Test::Builder might set the plan.  So TB1 was being very impolite doing its
own tracking.  This tracking has been moved into the History object available
to everyone as Test::Builder2::History->plan.


Test::Builder2::Tester
----------------------

A proof of concept implementation of a Test:: module tester using
Test::Builder2.  It is very small and elegant.  The interface works much like
Test::Tester.

I would really really really appreciate if other people worked on this so I
don't have to.

    use Test::More;
    use Test::Builder2::Tester;

    my $history = capture {
        plan tests => 2;
        is "this", "that", "this is that";
        ok 1, "pass";
    };

    my $plan = $history->plan;
    is $plan->asserts_expected, 2;

    my $results = $history->results;
    result_like $results->[0], {
        is_pass => 0,
        name    => "this is that",
        file    => $0,
        # Test::More doesn't do diagnostics this way yet
#       diagnostics => {
#               have    => "this",
#               want    => "that",
#       },
    };

    result_like $results->[1], {
        is_pass         => 1,
        file            => $0
    };

    done_testing;

capture() stores everything which happens in the block in its own history
which it hands back to the user.  You get all the same information which
Test::Builder does.  The actual functions for testing results are currently
lame... but that's ok because you can use any Test:: module you want to test 
them.

This was not planned, but just something which the event design made easy.

(If you run this, it's a bit leaky because diagnostics aren't run through the
formatter yet, but that will fix itself.)


2.00_06  Thu, 27 Jan 2011 09:58:35 +1000
    Incompatible Changes
    * The EventCoordinator now only has one history object.
      histories() is now history().  clear_history() and add_histories()
      are gone. [github 115]
    * Subtest handling has been removed from the TAP formatter.  The design
      was wrong.  It will come back later in a better form [github 120]
    * Test::Builder2::Counter, History and Formatter are no longer singletons.
      This is unnecessary, use the objects provided by your EventCoordinator.
      [github 117]
    * stream_depth() is now a method on the History object, not the TAP
      formatter.  This makes it available to all event watchers. [github 118]
    * history is now posted events before the formatter.  This lets the
      formatter ask the history object about the test state.
    * INNER_accept_event and INNER_accept_result are now gone from the
      Formatter.  Write accept_event and accept_result normally.
    * TB2->ok will now start the stream if there is not one already

    New Features
    * Added Test::Builder2::CanLoad to protect $! and $@ from tests loading
      modules internally.
    * Added Test::Builder2::Tester to test Test:: modules independent of
      their format. [github 112]
    * Added Test::Builder2::History->plan to capture the plan event so
      builders don't have to
    * Test::Builder no longer tracks the plan on its own, it uses the
      shared History object. [github 125]

    Bug Fixes
    * More $@ and $! protection.
    * Test::Builder now works with non-TAP formatters (or no formatter at all)


2.00_05  Mon, 24 Jan 2011 14:52:27 +1000
    Bug Fix
    * reset() was not grabbing a fresh copy of STDOUT and STDERR

    Test Fix
    * Fixed t/Builder/fork_with_new_stdout.t on Windows.


2.00_04  Tue Jan 18 11:50:48 EST 2011
    Test Fix
    * Work around a qr// bug in Debian etch's perl in t/Builder2/NoWarnings.t
    * Tests looking for Mouse can now correctly find it.

    New Features
    * Added a Log event (nothing using it yet)
    * Added a Comment event (nothing using it yet)

    Bug Fixes
    * Upgraded Mouse to 0.87
    * Fixed the SimpleHTML example
    * TB2::Streamer::TAP->error_fh could get accidentally initialized
      to undef.


2.00_03  Mon Jan 10 09:38:22 EST 2011
    Test Fix
    * Casing mistake in t/CanDupFilehandles.t


2.00_02  Sun Jan  9 21:20:30 EST 2011
    Second alpha release of Test::Builder2.
    Technology Demonstrator.
    Design complete.
    Threads broken.
    Subtests broken.
    Test::Builder converted to use Test::Builder2 infrastructure.
    Let's see how much of CPAN this breaks.


2.00_01  Mon Sep  6 14:42:38 2010 -0700
    First alpha release of Test::Builder2.
    Technology Preview.
    Very incomplete.


-- 
40. I do not have super-powers.
    -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
           http://skippyslist.com/list/

Reply via email to