Skip to content

Commit

Permalink
Add a test case for RSpec/ContextMethod when context without . or…
Browse files Browse the repository at this point in the history
… `#` at the beginning
  • Loading branch information
ydah committed Jan 11, 2023
1 parent a1ece2c commit 895730f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/rubocop/cop/rspec/context_method_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
RUBY
end

it 'ignores context without `.` or `#` at the beginning' do
expect_no_offenses(<<-RUBY)
context '_foo_bar' do
end
RUBY
end

it 'flags context with `.` at the beginning' do
expect_offense(<<-RUBY)
context '.foo_bar' do
Expand Down

0 comments on commit 895730f

Please sign in to comment.