Skip to content

Document that each test block returns to the original cwd? #100

Description

@schwern

I experimentally confirmed that tests blocks will return you to the original cwd the test was started in. This is a very useful feature, but I couldn't find it documented in either Fennec or Test::WorkFlow.

I'm hesitant to just document it as it appears to be a side effect of forking, and setting FENNEC_PARALLEL=0 breaks it. I use that when I want to debug tests.

Here's a small test to demonstrate the feature.

use Fennec;
use Path::Tiny;

tests "chdir" => sub {
    note( Path::Tiny->cwd );
    ok chdir "/";
};

tests "cwd" => sub {
    note( Path::Tiny->cwd );
    ok chdir "/";
};

done_testing;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions