Skip to content

Commit

Permalink
Test derivative case case style for BeNil cop
Browse files Browse the repository at this point in the history
  • Loading branch information
corsonknowles committed Oct 30, 2024
1 parent e80d28c commit bef5a35
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/rubocop/cop/rspec/be_nil_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,16 @@
RUBY
end
end

context 'with EnforcedStyle set but stubbed to `something_arbitrary` internally' do
let(:enforced_style) { 'be' }

it 'does not register any offenses' do
allow_any_instance_of(described_class).to receive(:style).and_return('something_arbitrary')
expect_no_offenses(<<~RUBY)
expect(foo).to be_nil
expect(foo).to be(nil)
RUBY
end
end
end

0 comments on commit bef5a35

Please sign in to comment.