Recently I've been experiencing a personal renaissance with regard to writing shell scripts in Ruby, like this little one that trivializes rolling back some migrations so you can either touch them up and re-run them or give up on them altogether.
I've been creating so many Ruby shell scripts that I wrote a Ruby shell script to remove the friction of writing new Ruby shell scripts. Running `new-script some-new-script-name` invokes this script and generates the following stub within my $PATH and marks it `chmod +x`.
Aug 8, 2018 • 7 tweets • 2 min read
I’m going to quote anonymously from someone who deleted their tweet: “It’s easy to write untestable code which is why writing tests first guards against that.” This is a super common argument for doing TDD, but when you dig into it, it’s actually circular logic. 🙇♂️
“It's easy to write untestable code" is only true if you insist on testing things in isolation at a unit level. In practice, I find even the most abhorrent one hundred line methods quite testable with headless browser tests, regardless of how the code is structured.