Sha256: 853d89734d171dc89de457107acbfd5915cfb828175588dd2aaaf60dc5853f7a

Contents?: true

Size: 717 Bytes

Versions: 16

Compression:

Stored size: 717 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_pattern

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rubocop-rspec-1.38.1 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.38.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.37.1 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.37.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.36.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.35.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.34.1 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.34.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.33.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.32.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.31.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.30.1 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.30.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.29.1 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.29.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-1.28.0 lib/rubocop/rspec/language/node_pattern.rb