Skip to content

Throwing an exception object in a test control method results in the object being dumped to the screen #102

@oschwald

Description

@oschwald

When an exception object is thrown from a test control method while using prove, the contents of the object are dumped to the screen rather than the stringified object.

For instance, with:

package TestsFor::Exception;

use Test::Class::Moose;
use Throwable::Error;

sub test_setup {
    Throwable::Error->throw('goodbye');
}

sub test_ok {
    ok(1);
}

package main;

use Test::Class::Moose::CLI;
Test::Class::Moose::CLI->new_with_options->run;

You get these 614 lines of output.

Note that this does not happen with yath. It could arguably be a bug in the Test2 TAP formatter. However, it is limited to exceptions in TCM test control methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions