Sha256: 265e9824057be4e2859b55c7c1d6e85090ab768c19a2dcf4a1a41d7865d35f2c

Contents?: true

Size: 842 Bytes

Versions: 13

Compression:

Stored size: 842 Bytes

Contents

def enable_hotspots
  MetricFu.configure
  hotspot_metrics = MetricFu::Metric.metrics.map(&:name)
  hotspot_metrics.each do |metric_name|
    path = "#{metric_name}/hotspot"
    begin
      MetricFu.metrics_require { path }
    rescue LoadError
      # No hotspot, but that's ok
    end
  end
end

def metric_not_activated?(metric_name)
  MetricFu.configuration.configure_metrics
  metric = MetricFu::Metric.get_metric(metric_name.intern)
  if (metric.activate rescue false) # may fail if ripper not supported
    false
  else
    p "Skipping #{metric_name} tests, not activated"
    true
  end
end

def breaks_when?(bool)
  p "Skipping tests in #{caller[0]}. They unnecessarily break the build." if bool
  bool
end

def compare_paths(path1, path2)
  expect(File.join(MetricFu.root_dir, path1)).to eq(File.join(MetricFu.root_dir, path2))
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
metric_fu-4.13.0 spec/support/helper_methods.rb
fastruby-metric_fu-5.0.0 spec/support/helper_methods.rb
code_metric_fu-4.14.4 spec/support/helper_methods.rb
code_metric_fu-4.14.3 spec/support/helper_methods.rb
code_metric_fu-4.14.2 spec/support/helper_methods.rb
code_metric_fu-4.14.1 spec/support/helper_methods.rb
code_metric_fu-4.14.0 spec/support/helper_methods.rb
metric_fu-4.12.0 spec/support/helper_methods.rb
metric_fu-4.11.4 spec/support/helper_methods.rb
metric_fu-4.11.3 spec/support/helper_methods.rb
metric_fu-4.11.2 spec/support/helper_methods.rb
metric_fu-4.11.1 spec/support/helper_methods.rb
metric_fu-4.11.0 spec/support/helper_methods.rb