it reads oddly having the heredoc overflow the expectation.  Maybe pull out the heredoc into a local above the expectation?