Minor, but consider breaking the line at `to`. This way results in one less line:
```ruby
expect(violations_in("def foo\n  bar\nend\ndef bar\n  foo\nend")).
  to eq [ 'Use empty lines between defs.' ]
```