Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Dump ${output} from tests by default? #105

Closed
nathanleclaire opened this issue Jun 2, 2015 · 1 comment
Closed

Dump ${output} from tests by default? #105

nathanleclaire opened this issue Jun 2, 2015 · 1 comment

Comments

@nathanleclaire
Copy link

I would really prefer that run would just dump ${output} by default when something went wrong in the test, rather than having to add it everywhere I might want some debug output. We use run quite extensively.

Is there any way to just have each test do something like echo ${output} by default?

cc @mislav @sstephenson

@nathanleclaire
Copy link
Author

Hmm, I just realized that we have a little hook in our helpers.bash file which we import to every test which does something very similar:

teardown () {
    echo "$BATS_TEST_NAME
--------
$output
--------

"   >> ${BATS_LOG}
}

I can just look at that file / use tail -f to track the results in "real-time"ish.

@ztombol ztombol mentioned this issue Dec 13, 2016
18 tasks
yarikoptic pushed a commit to neurodebian/bats that referenced this issue Aug 6, 2019
Suggested by @HRio during the review of sstephenson#105. Unrolled the loop since
there's so few commands now, and tweaked the `PREFIX` test and usage
message.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant