Sha256: 9af9d7d2a19106a476ef1a7b54b975af6103b2e47d4063c9b760895a290d50c2

Contents?: true

Size: 818 Bytes

Versions: 3

Compression:

Stored size: 818 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{|m|m.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')))
      lambda{ File.read(File.join(output_dir, "#{key.to_s.downcase}.js")) }.should_not raise_error
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
metric_fu-4.6.0 spec/metric_fu/reporting/graphs/grapher_spec.rb
metric_fu-4.5.2 spec/metric_fu/reporting/graphs/grapher_spec.rb
metric_fu-4.5.1 spec/metric_fu/reporting/graphs/grapher_spec.rb