From 895730f2d4f0562e690fff9605222599e100dc8b Mon Sep 17 00:00:00 2001 From: ydah <13041216+ydah@users.noreply.github.com> Date: Wed, 11 Jan 2023 19:40:36 +0900 Subject: [PATCH] Add a test case for `RSpec/ContextMethod` when context without `.` or `#` at the beginning --- spec/rubocop/cop/rspec/context_method_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/rubocop/cop/rspec/context_method_spec.rb b/spec/rubocop/cop/rspec/context_method_spec.rb index fae76377f..3c6b3cca3 100644 --- a/spec/rubocop/cop/rspec/context_method_spec.rb +++ b/spec/rubocop/cop/rspec/context_method_spec.rb @@ -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