2021-02-11 16:09:00 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-10-11 13:10:42 -04:00
|
|
|
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
|
|
|
|
|
2020-11-05 13:08:48 -05:00
|
|
|
path.start_with?(File.join(Dir.pwd, 'qa'))
|
2018-10-11 13:10:42 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|