Improve debugging capabilities
When running test, it is quite common to use ruby-debug using binding.b
. However, when using this in combination with Ruby Test Runner, I get output like this when (for example) typing hello
(ruby 3.1.4, rails 7, macOS Ventura):
(rdbg) hello (rdbg) h # help command(rdbg) he(rdbg) hel(rdbg) hell(rdbg) helloeval error: undefined local variable or method `hello'
Also, arrow keys for running previous commands don't work and print ANSI chars instead.
This issue seems to be caused by the print_and_save
script. When I replace its contents with:
# DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# echo "$($@ | tee /dev/tty)\n" > $DIR/tests.out
$@
..which effectively just executes the sent command (using bundle exec). In this case I don't have any of the mentioned issues anymore. However, I'm probably losing some functionality here, therefore I was wondering if this could be fixed somehow.