Sha256: 62335e3b3eaa3afb718e8edaee4f381c28094794ac081d559edcd21b7f3f5c0c

Contents?: true

Size: 1.22 KB

Versions: 15

Compression:

Stored size: 1.22 KB

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module RSpec
      # Helps check offenses with variable definitions
      module SkipOrPending
        extend RuboCop::NodePattern::Macros

        # @!method skipped_in_metadata?(node)
        def_node_matcher :skipped_in_metadata?, <<-PATTERN
          {
            (send _ _ <(sym {:skip :pending}) ...>)
            (send _ _ ... (hash <(pair (sym {:skip :pending}) { true str dstr }) ...>))
          }
        PATTERN

        # @!method skip_or_pending_inside_block?(node)
        #   Match skip/pending statements inside a block (e.g. `context`)
        #
        #   @example source that matches
        #     context 'when color is blue' do
        #       skip 'not implemented yet'
        #       pending 'not implemented yet'
        #     end
        #
        #   @example source that does not match
        #     skip 'not implemented yet'
        #     pending 'not implemented yet'
        #
        #   @param node [RuboCop::AST::Node]
        #   @return [Array<RuboCop::AST::Node>] matching nodes
        def_node_matcher :skip_or_pending_inside_block?, <<-PATTERN
          (block <(send nil? {:skip :pending} ...) ...>)
        PATTERN
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 4 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-rspec-2.22.0/lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.25.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.24.1 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.24.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.23.2 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.23.1 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.23.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
mlh-rubocop-config-1.0.2 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.22.0/lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.22.0/lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-rspec-2.22.0/lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
fablicop-1.10.2 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.22.0/lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.22.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.21.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.20.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.19.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb