Is there an easy way to test/capture STDOUT/STDERR produced by running an external command?

Open
#951 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
perl
Domain
testing

Research direction

Start by reading the Test2::Tools::Tiny capture method and the linked Test::Output documentation, then compare how each handles output from an external command. Done means identifying or adding a supported Test2 approach for capturing both STDOUT and STDERR, with usage guidance or a test demonstrating it.

Written by the indexing model from the issue text.

Description

I would like to use Test2 to test the output produced by an external command. In the old Test::More framework you could use Test::Output. I could not find anything similar in Test2. I found that Test2::Tools::Tiny has a capture method but I could not make it work.

Dominant language
Perl
Stars
149
Forks
98
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Test-More/test-more

All issues in Test-More/test-more

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.