< Summary - Neospec Coverage

Information
Class: realCommandRunner
Assembly: runner
File(s): /home/runner/work/neospec/neospec/internal/adapters/runner/exec.go
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 22
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Run0%00100%

File(s)

/home/runner/work/neospec/neospec/internal/adapters/runner/exec.go

#LineLine coverage
 1package runner
 2
 3import (
 4  "bytes"
 5  "context"
 6  "os"
 7  "os/exec"
 8)
 9
 10// realCommandRunner is the production CommandRunner that delegates to
 11// exec.CommandContext. It is the Adapter that wraps the os/exec stdlib API.
 12type realCommandRunner struct{}
 13
 214func (realCommandRunner) Run(ctx context.Context, env []string, name string, args ...string) ([]byte, []byte, error) {
 215  cmd := exec.CommandContext(ctx, name, args...)
 216  cmd.Env = append(os.Environ(), env...)
 217  var stdout, stderr bytes.Buffer
 218  cmd.Stdout = &stdout
 219  cmd.Stderr = &stderr
 220  err := cmd.Run()
 221  return stdout.Bytes(), stderr.Bytes(), err
 222}

Methods/Properties

Run