summaryrefslogtreecommitdiff
path: root/rubocop/qa_helpers.rb
blob: f4adf7f4e9f0ce9e44c82ea531ac32f0fad67da8 (plain)
1
2
3
4
5
6
7
8
9
10
11
module RuboCop
  # Module containing helper methods for writing QA cops.
  module QAHelpers
    # Returns true if the given node originated from the qa/ directory.
    def in_qa_file?(node)
      path = node.location.expression.source_buffer.name

      path.start_with?(File.join(Dir.pwd, 'qa'))
    end
  end
end