Sha256: c80f9fe45ea67ac799ee6f8d907b602e0f46d19095c1c47f233d4992f2b8d98f

Contents?: true

Size: 815 Bytes

Versions: 9

Compression:

Stored size: 815 Bytes

Contents

require "spec_helper"

describe "Bluff graphers responding to #graph!" do
  before do
    setup_fs
  end
  after do
    cleanup_fs
  end
  it "should write chart file" do
    graphs = {}
    available_graphs = MetricFu::Metric.enabled_metrics.select(&:has_graph?).map(&:name)
    available_graphs.each do |graph|
      grapher_name = graph.to_s.gsub("MetricFu::", "").gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
      grapher_name =  grapher_name + "Grapher"
      graphs[graph] = MetricFu.const_get(grapher_name).new
    end
    graphs.each do |key, val|
      val.graph!
      output_dir = File.expand_path(File.join(MetricFu::Io::FileSystem.directory("output_directory")))
      expect { File.read(File.join(output_dir, "#{key.to_s.downcase}.js")) }.not_to raise_error
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
metric_fu-4.13.0 spec/metric_fu/reporting/graphs/grapher_spec.rb
fastruby-metric_fu-5.0.0 spec/metric_fu/reporting/graphs/grapher_spec.rb
code_metric_fu-4.14.4 spec/metric_fu/reporting/graphs/grapher_spec.rb
code_metric_fu-4.14.3 spec/metric_fu/reporting/graphs/grapher_spec.rb
code_metric_fu-4.14.2 spec/metric_fu/reporting/graphs/grapher_spec.rb
code_metric_fu-4.14.1 spec/metric_fu/reporting/graphs/grapher_spec.rb
code_metric_fu-4.14.0 spec/metric_fu/reporting/graphs/grapher_spec.rb
metric_fu-4.12.0 spec/metric_fu/reporting/graphs/grapher_spec.rb
metric_fu-4.11.4 spec/metric_fu/reporting/graphs/grapher_spec.rb