A Better Way to Format Long Strings
Sometimes you just need long strings.
In tests, I sometimes like to include tiny CSVs as a part of the test code instead of a fixture file. However, that looks real gross real fast with all the linebreaks.
Heredocs to the rescue!
In Ruby, instead of:
sample_csv = "foo,bar,baz\na,b,c\nd,e,f\n,g,h,i"
You can do something like:
sample_csv = <<~EOS foo,bar,baz a,b,c d,e,f g,h,i EOS
Isn't that much better?