Sha256: 59abe2d32d6198f2df0ec558525cf850c6c2a40d1c2d214e29a664ea64d36a9a

Contents?: true

Size: 731 Bytes

Versions: 2

Compression:

Stored size: 731 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module RSpec
    module Language
      # Common node matchers used for matching against the rspec DSL
      module NodePattern
        extend RuboCop::NodePattern::Macros

        def_node_matcher :example_group?, ExampleGroups::ALL.block_pattern

        def_node_matcher :example_group_with_body?, <<-PATTERN
          (block #{ExampleGroups::ALL.send_pattern} args [!nil?])
        PATTERN

        def_node_matcher :example?, Examples::ALL.block_pattern

        def_node_matcher :hook?, Hooks::ALL.block_pattern

        def_node_matcher :let?, Helpers::ALL.block_or_block_pass_pattern

        def_node_matcher :subject?, Subject::ALL.block_pattern
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubocop-rspec-1.40.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.39.0 lib/rubocop/rspec/language/node_pattern.rb