From d3e4268136201f60deba051939b5b92e6f2c3168 Mon Sep 17 00:00:00 2001 From: Dave Corson-Knowles Date: Sun, 13 Oct 2024 05:22:40 -0700 Subject: [PATCH] Complete branch coverage for VoidExpect and ContextWording --- spec/rubocop/cop/rspec/context_wording_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/rubocop/cop/rspec/context_wording_spec.rb b/spec/rubocop/cop/rspec/context_wording_spec.rb index 5896110af..340d10181 100644 --- a/spec/rubocop/cop/rspec/context_wording_spec.rb +++ b/spec/rubocop/cop/rspec/context_wording_spec.rb @@ -214,4 +214,17 @@ end end end + + context 'when `AllowedPatterns:` and `Prefixes:` are both empty' do + let(:cop_config) do + { 'Prefixes' => [], 'AllowedPatterns' => [] } + end + + it 'skips any description' do + expect_no_offenses(<<~RUBY) + context 'arbitrary text' do + end + RUBY + end + end end