Created
April 25, 2012 05:25
-
-
Save jamesmanning/2486751 to your computer and use it in GitHub Desktop.
ruby flexible quoting adds initial newline that here-doc does not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_old_style_here_doc | |
here_doc_style = <<WHEE | |
foo | |
bar | |
WHEE | |
flexible_quote_style = %{ | |
foo | |
bar | |
} | |
assert_equal 8, here_doc_style.length | |
assert_equal 2, here_doc_style.lines.count | |
assert_equal "foo\nbar\n", here_doc_style | |
assert_equal 9, flexible_quote_style.length | |
assert_equal 3, flexible_quote_style.lines.count | |
assert_equal "\nfoo\nbar\n", flexible_quote_style | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment