Skip to content

Commit

Permalink
Improve a bit more the snake_case file name warning reported by Style…
Browse files Browse the repository at this point in the history
…/FileName
  • Loading branch information
bbatsov authored and Neodelf committed Oct 15, 2016
1 parent badfad0 commit 5612c14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/file_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Style
# names. Ruby scripts (i.e. source files with a shebang in the
# first line) are ignored.
class FileName < Cop
MSG_SNAKE_CASE = 'The file name for this source (%s) ' \
MSG_SNAKE_CASE = 'The name of this source file (`%s`) ' \
'should use snake_case.'.freeze
MSG_NO_DEFINITION = '%s should define a class or module ' \
'called `%s`.'.freeze
Expand Down
5 changes: 3 additions & 2 deletions spec/rubocop/cop/style/file_name_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@

it 'registers an offense' do
expect(cop.offenses.size).to eq(1)
expect(cop.messages).to eq(
['The file name for this source (a file.rb) should use snake_case.'])
expect(cop.messages)
.to eq(['The name of this source file (`a file.rb`) ' \
'should use snake_case.'])
end
end

Expand Down

0 comments on commit 5612c14

Please sign in to comment.