Skip to content

Commit

Permalink
fixing a spec for google graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
jscruggs committed Jan 9, 2010
1 parent 015d2bf commit 1c9bb5f
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions spec/graphs/engines/gchart_spec.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")

describe "Gchart graphers responding to #graph!" do
it "should write chart file" do
MetricFu.configuration
graphs = {}
MetricFu::AVAILABLE_GRAPHS.each do |graph|
graphs[graph] = MetricFu.const_get("#{graph.to_s.capitalize}GchartGrapher").new
end
graphs.each do |key, val|
val.graph!
lambda{ File.open(File.join(MetricFu.output_directory, "#{key.to_s.downcase}.png")) }.should_not raise_error
MetricFu::AVAILABLE_GRAPHS.each do |metric|
it "should write chart file for #{metric}" do
MetricFu.configuration
grapher = MetricFu.const_get("#{metric.to_s.capitalize}GchartGrapher").new
grapher.flog_average, grapher.top_five_percent_average = [7.0],[20.0] if metric == :flog #googlecharts gem has problems with [[],[]] as data
grapher.graph!
lambda{ File.open(File.join(MetricFu.output_directory, "#{metric.to_s.downcase}.png")) }.should_not raise_error
end
end
end

0 comments on commit 1c9bb5f

Please sign in to comment.