Skip to content

Commit

Permalink
Merge pull request #1548 from ydah/add-test-case
Browse files Browse the repository at this point in the history
Add a test case for `RSpec/ContextMethod` when context without `.` or `#` at the beginning
  • Loading branch information
pirj committed Jan 11, 2023
2 parents a1ece2c + f3660dd commit d87efcf
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 "when it's sunny" 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 d87efcf

Please sign in to comment.