Skip to content

Commit 42c5a9b

Browse files
committed
rebase: apply review feedback on Test-More#352
Here's the summary of changes: - **`t/unit/Test2/Harness/IPC/Util.t`**: Added `local $ENV{T2_HARNESS_PROC_PREFIX};` in the `set_procname` subtest to clear the env var before testing. When tests run under yath, `T2_HARNESS_PROC_PREFIX` is set by `App::Yath::Options::Harness`, overriding the default `'Test2-Harness'` prefix and causing the regex assertions to fail. - **`t/unit/Test2/Harness/Reloader/Inotify2.t`**: Changed all `stage_name => ...` constructor args to `stage => ...`. The `Reloader::init()` method populates `stage_name` from the `stage` parameter — passing `stage_name` directly gets overwritten to undef (then defaults to `"Unknown stage"`), causing the accessor assertion to fail.
1 parent b5eb6bb commit 42c5a9b

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

t/unit/Test2/Harness/IPC/Util.t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ subtest 'pid_is_running' => sub {
2424

2525
subtest 'set_procname' => sub {
2626
my $orig = $0;
27+
local $ENV{T2_HARNESS_PROC_PREFIX};
2728

2829
set_procname(set => ['test-worker']);
2930
like($0, qr/Test2-Harness/, "default prefix applied");

t/unit/Test2/Harness/Reloader/Inotify2.t

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ subtest isa => sub {
88
};
99

1010
subtest construction => sub {
11-
my $r = CLASS->new(stage_name => 'inotify_test');
11+
my $r = CLASS->new(stage => 'inotify_test');
1212
ok($r, "constructed");
1313
is($r->stage_name, 'inotify_test', "stage_name accessor");
1414
is($r->watcher, undef, "watcher is undef before start");
1515
};
1616

1717
subtest changed_files_requires_start => sub {
18-
my $r = CLASS->new(stage_name => 'test');
18+
my $r = CLASS->new(stage => 'test');
1919

2020
like(
2121
dies { $r->changed_files },
@@ -25,22 +25,22 @@ subtest changed_files_requires_start => sub {
2525
};
2626

2727
subtest start_sets_watcher => sub {
28-
my $r = CLASS->new(stage_name => 'test');
28+
my $r = CLASS->new(stage => 'test');
2929
$r->start;
3030
ok($r->watcher, "watcher set after start");
3131
ok($r->watcher->isa('Linux::Inotify2'), "watcher is a Linux::Inotify2 instance");
3232
$r->stop;
3333
};
3434

3535
subtest stop_clears_watcher => sub {
36-
my $r = CLASS->new(stage_name => 'test');
36+
my $r = CLASS->new(stage => 'test');
3737
$r->start;
3838
$r->stop;
3939
is($r->watcher, undef, "watcher cleared after stop");
4040
};
4141

4242
subtest changed_files_returns_arrayref => sub {
43-
my $r = CLASS->new(stage_name => 'test');
43+
my $r = CLASS->new(stage => 'test');
4444
$r->start;
4545
my $changed = $r->changed_files;
4646
ok(ref($changed) eq 'ARRAY', "changed_files returns an arrayref");

0 commit comments

Comments
 (0)