spec/support/helper_methods.rb in metric_fu-4.10.0 vs spec/support/helper_methods.rb in metric_fu-4.11.0
- old
+ new
@@ -1,20 +1,21 @@
def enable_hotspots
MetricFu.configure
hotspot_metrics = MetricFu::Metric.metrics.map(&:name)
hotspot_metrics.each do |metric_name|
- path = "#{metric_name}/#{metric_name}_hotspot"
+ 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
- if MetricFu::Metric.get_metric(metric_name.intern).activate
+ 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