sstephenson / bats

Bash Automated Testing System
MIT License
7.12k stars 519 forks source link

Running bats tests interactively #172

Open MisanthropicBit opened 8 years ago

MisanthropicBit commented 8 years ago

First of all, thanks for a great bash testing tool! 👍

Almost all of my tests rely on variables that are only expanded when the script is run as an interactive shell, however this does not seem to be possible in bats atm.

Is there any way to make bats run tests interactively or is there some other workaround?

Bash and bats versions are:

GNU bash, version 4.3.42(1)-release (x86_64-apple-darwin15.0.0)

Bats 0.4.0

As an aside, most test frameworks I've used in the past tend to color passing tests in green and possibly skipped tests in yellow. Since bats already colors failing tests in red, I was wondering is this is simply an aesthetic choice or due to something else?

screen shot 2016-06-08 at 12 39 08
Nachtfeuer commented 8 years ago

As a propose for a potential solution ... When each test is finally a temporary bash script in /tmp you could use this: http://bashdb.sourceforge.net/ as tool. You could provide an option --debug to use it

MisanthropicBit commented 8 years ago

Thanks for the proposal. Just to be clear: Do you mean to run bashdb with the --debug option on the temporary files created by bats?

Nachtfeuer commented 8 years ago

Exactly

MisanthropicBit commented 8 years ago

Thanks! I'll try it out and see if it will also work on Travis CI 👍