Second video about writing unit tests for Bash scripts. We'll see how to manipulate the file systems for our testing needs, without creating dependencies between tests.
Small "mistake": the line "rm -rf testdata" should be in the tearDown function, to clean the test data after each test (and not before).
Files: https://github.com/Phantas0s/mouseless-dev-youtube/blob/master/bash_best_practice/backup_05
shunit2: https://github.com/kward/shunit2
I'm using Neovim with shellcheck for static analysis. For snippets, ultisnips is my friend.
π Building Your Mouseless Development Environment: https://themouseless.dev
π Learning to Play Vim: https://themouseless.dev/vim
π Increase your value as a developer: https://thevaluable.dev
π Github: https://github.com/Phantas0s
π Support the channel: https://github.com/sponsors/Phantas0s