Module: Datadog::CI::Contrib::Minitest::Helpers

Defined in:
lib/datadog/ci/contrib/minitest/helpers.rb

Class Method Summary collapse

Class Method Details

.parallel?(klass) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
# File 'lib/datadog/ci/contrib/minitest/helpers.rb', line 15

def self.parallel?(klass)
  klass.ancestors.include?(::Minitest::Parallel::Test) ||
    (defined?(::Minitest::Queue) && ::Minitest.singleton_class.ancestors.include?(::Minitest::Queue))
end

.test_suite_name(klass, method_name) ⇒ Object



8
9
10
11
12
13
# File 'lib/datadog/ci/contrib/minitest/helpers.rb', line 8

def self.test_suite_name(klass, method_name)
  source_location, = klass.instance_method(method_name).source_location
  source_file_path = Pathname.new(source_location.to_s).relative_path_from(Pathname.pwd).to_s

  "#{klass.name} at #{source_file_path}"
end