Really fixing them would be nicer but that can be complicated, so just run them 3 times and if they fail every time fail, otherwise pass with warnings.
Code
Really fixing them would be nicer but that can be complicated, so just run them 3 times and if they fail every time fail, otherwise pass with warnings.
Code
The official solution for this problem is to use e.g. CGI.escape thing.to_str,
my unofficial solution is to automate that ๐
Code
I’m currently doing a lot of history rewrites to keep my branch clean (tons of changes that I rebase regularly)
So I built git-edit
Usage
git-edit abf1234 ... do some work ... git-edit --amend # amend changes to abf1234 and finish # or if things go south ... git-edit --abort # get me out of here ๐
Install
Install ruby.
curl https://raw.github.com/grosser/dotfiles/master/bin/git-edit >\ ~/bin/git-edit && chmod +x ~/bin/git-edit
Remember: Do not use unless you are the only one working on this branch!
Very useful helper if you want to keep your environment clean, useful for testing or if you have to require something that has lots of side effects or memory leaks.
Usage
result = fork_and_return do require 'some_lib_with_side_effects' leak_some_memory get_stuff_done end puts result
Code
# https://grosser.it/2012/07/15/return-values-from-fork-fork_and_return/ def fork_and_return(&block) require 'parallel' Parallel.map([0], &block).first end
If you like test::unit or are simply stuck with it, this works great on ruby 1.8 and 1.9+, have fun ๐
gem install testrbl testrbl test/unit/xxx.rb:15 # test or should or context on line 15 testrbl test/unit.xxx.rb # all tests in xxx.rb testrbl test/unit # all tests in folder