From 7cf365f645826d15c7509e66dff8b47459fd1804 Mon Sep 17 00:00:00 2001 From: ydah <13041216+ydah@users.noreply.github.com> Date: Wed, 4 Oct 2023 00:35:43 +0900 Subject: [PATCH] Follow up https://github.com/rubocop/rubocop-rspec/pull/1692#discussion_r1288432020 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow up: https://github.com/rubocop/rubocop-rspec/pull/1692#discussion_r1288432020 ``` ❯ bundle exec rubocop -A Inspecting 291 files ...........................................................................................................................................C....................................................................................................................................................... Offenses: lib/rubocop/cop/rspec/void_expect.rb:55:11: C: [Corrected] Workit/RedundantBooleanConditional: This conditional expression can just be replaced by parent.block_type? && parent.body == expect. true if parent.block_type? && parent.body == expect ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 291 files inspected, 1 offense detected, 1 offense corrected ``` --- lib/rubocop/cop/rspec/void_expect.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rubocop/cop/rspec/void_expect.rb b/lib/rubocop/cop/rspec/void_expect.rb index ae0f87a2b..5b315fd00 100644 --- a/lib/rubocop/cop/rspec/void_expect.rb +++ b/lib/rubocop/cop/rspec/void_expect.rb @@ -52,7 +52,7 @@ def void?(expect) return true unless parent return true if parent.begin_type? - true if parent.block_type? && parent.body == expect + parent.block_type? && parent.body == expect end end end