Sha256: d0cdad6617bb9ce882d1b81df3b914d0663fc69e0e4f19d9310c84697cf20eaa

Contents?: true

Size: 484 Bytes

Versions: 14

Compression:

Stored size: 484 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module RSpec
    module Language
      # Helper methods to detect RSpec DSL used with send and block
      module NodePattern
        def send_pattern(string)
          "(send #rspec? #{string} ...)"
        end

        def block_pattern(string)
          "(block #{send_pattern(string)} ...)"
        end

        def numblock_pattern(string)
          "(numblock #{send_pattern(string)} ...)"
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-rspec-2.13.1/lib/rubocop/rspec/language/node_pattern.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-rspec-2.13.1/lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-2.18.1 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-2.18.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-2.17.1 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-2.17.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-2.16.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-2.15.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-2.14.2 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-2.14.1 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-2.14.0 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-2.13.2 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-2.13.1 lib/rubocop/rspec/language/node_pattern.rb
rubocop-rspec-2.13.0 lib/rubocop/rspec/language/node_pattern.rb