Skip to content

Commit

Permalink
Pick "describe the methods" rule from betterspecs
Browse files Browse the repository at this point in the history
  • Loading branch information
andreareginato authored and pirj committed Nov 2, 2018
1 parent 9439ec4 commit c19f746
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Expand Up @@ -834,6 +834,32 @@ meant to be able to change with it.
end
```

* <a name="describe-the-methods"></a>
Be clear about what method you are describing. Use the Ruby
documentation convention of `.` when referring to a class method's
name and `#` when referring to an instance method's name.
<sup>[[link](#describe-the-methods)]</sup>

```ruby
# bad
describe 'the authenticate method for User' do
# ...
end

describe 'if the user is an admin' do
# ...
end

# good
describe '.authenticate' do
# ...
end

describe '#admin?' do
# ...
end
```

## Matchers

* <a name="predicate-matchers"></a>
Expand Down

0 comments on commit c19f746

Please sign in to comment.