bats-core / bats-assert

Common assertions for Bats
Creative Commons Zero v1.0 Universal
96 stars 42 forks source link

[feature] assert_output should --separate-stderr in run #48

Closed nicola-lunghi closed 2 years ago

nicola-lunghi commented 2 years ago
@test "ut get_port invalidmachine" {
    # badtestmachine is not in the config
    run --separate-stderr -- get_port "badtestmachine"
    assert_failure
    assert_output "ERROR: Machine 'badtestmachine' is not valid"
}

This passes without --separate-stderr add an option or a command to test also for stderr. This should apply also to the other assert_ functions.

nicola-lunghi commented 2 years ago

maybe add a '--stderr' option to assert_output?

martin-schulze-vireso commented 2 years ago

See #42 for a related discussion. If you want to check stderr, you can either not use --separate-stderr or use the workaround in the linked issue.

nicola-lunghi commented 2 years ago

Nice! Yes that solve the issue thanks!