Sha256: ac369af2fab72d78b84f3eddbcd44b5ce355a7b8d12194b41036a22a07ce3ec5

Contents?: true

Size: 1.22 KB

Versions: 24

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

24 entries across 24 versions & 5 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-3.0.3/lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-3.3.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-3.2.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-3.1.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-3.0.5 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-3.0.4 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-3.0.1/lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-3.0.3 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-3.0.2 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/rubocop-rspec-3.0.1/lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-3.0.1 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-3.0.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-3.0.0.pre lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.31.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.30.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.29.2 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.29.1 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.29.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.28.0 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb
rubocop-rspec-2.27.1 lib/rubocop/cop/rspec/mixin/skip_or_pending.rb