Permalink
Browse files

Add test for smooth with constant data and target

Signed-off-by: Geoffrey Grosenbach <boss@topfunky.com>
  • Loading branch information...
1 parent fb1715d commit 7945408f46767637fd7414c1140f822a32843403 @kim-toms kim-toms committed with Jun 10, 2009
Showing with 9 additions and 0 deletions.
  1. +9 −0 test/test_all.rb
View
@@ -18,6 +18,7 @@ def setup
115 120 130 140 150 160 170 100 100 10).map {|i| i.to_f}
@nil_data = @data.dup
[5, 10, 11, 20, 25, 26, 27].each {|i| @nil_data[i] = nil}
+ @constant_data = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
end
test "basic bullet" do
@@ -112,6 +113,10 @@ def test_each_graph_with_nil
end
end
+ def test_smooth_graph_with_target_and_constant_data
+ constant_graph("constant_smooth", :type => 'smooth', :label => 'a-label', :target => 1)
+ end
+
def test_whisker_decimals
@data = (1..200).map {|n| n.to_f/100 }
quick_graph("labeled_whisker_decimals", {
@@ -306,6 +311,10 @@ def nil_graph(name, options)
Sparklines.plot_to_file("#{@output_dir}/#{name}.png", @nil_data, options)
end
+ def constant_graph(name, options)
+ Sparklines.plot_to_file("#{@output_dir}/#{name}.png", @constant_data, options)
+ end
+
end
# HACK Make reference HTML file for viewing output

0 comments on commit 7945408

Please sign in to comment.