lib/rubocop/cop/rspec/pending.rb in rubocop-rspec-2.22.0 vs lib/rubocop/cop/rspec/pending.rb in rubocop-rspec-2.23.0
- old
+ new
@@ -39,14 +39,19 @@
# @!method skippable?(node)
def_node_matcher :skippable?, <<~PATTERN
{
(send #rspec? #ExampleGroups.regular ...)
- (send nil? #Examples.regular ...)
+ #skippable_example?
}
PATTERN
+ # @!method skippable_example?(node)
+ def_node_matcher :skippable_example?, <<~PATTERN
+ (send nil? #Examples.regular ...)
+ PATTERN
+
# @!method pending_block?(node)
def_node_matcher :pending_block?, <<~PATTERN
{
(send #rspec? #ExampleGroups.skipped ...)
(send nil? {#Examples.skipped #Examples.pending} ...)
@@ -60,10 +65,15 @@
end
private
def skipped?(node)
- skippable?(node) && skipped_in_metadata?(node)
+ skippable?(node) && skipped_in_metadata?(node) ||
+ skipped_regular_example_without_body?(node)
+ end
+
+ def skipped_regular_example_without_body?(node)
+ skippable_example?(node) && !node.block_node
end
end
end
end
end