Merge branch 'improve-testing-styleguide' into 'master'

Document that we always use `do...end` for `before` in RSpec

[ci skip]

See merge request !7697
This commit is contained in:
Robert Speicher 2016-11-24 11:08:27 +00:00
commit 3e44ed3e2b

View file

@ -63,6 +63,8 @@ the command line via `bundle exec teaspoon`, or via a web browser at
- Use `.method` to describe class methods and `#method` to describe instance - Use `.method` to describe class methods and `#method` to describe instance
methods. methods.
- Use `context` to test branching logic. - Use `context` to test branching logic.
- Use multi-line `do...end` blocks for `before` and `after`, even when it would
fit on a single line.
- Don't `describe` symbols (see [Gotchas](gotchas.md#dont-describe-symbols)). - Don't `describe` symbols (see [Gotchas](gotchas.md#dont-describe-symbols)).
- Don't assert against the absolute value of a sequence-generated attribute (see [Gotchas](gotchas.md#dont-assert-against-the-absolute-value-of-a-sequence-generated-attribute)). - Don't assert against the absolute value of a sequence-generated attribute (see [Gotchas](gotchas.md#dont-assert-against-the-absolute-value-of-a-sequence-generated-attribute)).
- Don't supply the `:each` argument to hooks since it's the default. - Don't supply the `:each` argument to hooks since it's the default.