Sha256: 8a728788f2208959e37acb8d109e8e2ab62eb6b8ddecfbdceae94ac7c48dc3b3

Contents?: true

Size: 812 Bytes

Versions: 69

Compression:

Stored size: 812 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module RSpec
    # Wrapper for RSpec examples
    class Example < Concept
      # @!method extract_doc_string(node)
      def_node_matcher :extract_doc_string,     '(send _ _ $_ ...)'

      # @!method extract_metadata(node)
      def_node_matcher :extract_metadata,       '(send _ _ _ $...)'

      # @!method extract_implementation(node)
      def_node_matcher :extract_implementation, '(block send args $_)'

      def doc_string
        extract_doc_string(definition)
      end

      def metadata
        extract_metadata(definition)
      end

      def implementation
        extract_implementation(node)
      end

      def definition
        if node.send_type?
          node
        else
          node.send_node
        end
      end
    end
  end
end

Version data entries

69 entries across 63 versions & 7 rubygems

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