Closed driket closed 9 years ago
+1 Came here just for this. Nice work.
+1 Nice work
:+1:
I disagree for a very simple reason. Specs should use as straightforward a language as possible. Using single quotes means you'll have to manually escape any apostrophe in words like:
The Ruby Style Guide is a guide, not a law or a religious text. More importantly, there is no demonstrable performance difference between single and double quoted strings.
Hi @driket and everyone else, I think @olivierlacan made a good point. I'm going to close this one for now, but feel free to continue the discussion, or even making another / reopening the existing PR that changes everything to double quotes.
'it', 'describe' and 'context' blocs are generally static text strings. Since they don't need string interpolations and/or symbols, they shouldn't use double quoted strings.
I tend to use this guide as a reference, because most of Ruby linters / static code analyzers follow it (Rubocop, Puppet Linter, Cane) : https://github.com/bbatsov/ruby-style-guide
Unfortunately there are two different opinions about usage of single/double quoted strings. None of them is "the officially recognized one" as far as I know.