Skip to content

Commit

Permalink
Merge pull request #1808 from rubocop/follow1
Browse files Browse the repository at this point in the history
Add test case for `RSpec/SpecFilePathFormat`
  • Loading branch information
pirj authored Feb 16, 2024
2 parents aedcc06 + c0c3e04 commit f9abbde
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/rubocop/cop/rspec/spec_file_path_format_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
RUBY
end

it 'registers an offense when wrong top-level class name' do
expect_offense(<<~RUBY, 'wrong_class_spec.rb')
describe ::MyClass do; end
^^^^^^^^^^^^^^^^^^ Spec path should end with `my_class*_spec.rb`.
RUBY
end

it 'registers an offense when wrong class name with a symbol argument' do
expect_offense(<<~RUBY, 'wrong_class_spec.rb')
describe MyClass, :foo do; end
Expand Down

0 comments on commit f9abbde

Please sign in to comment.