Skip to content

Commit

Permalink
Add test for smooth with constant data and target
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffrey Grosenbach <boss@topfunky.com>
  • Loading branch information
kim-toms authored and topfunky committed Jul 6, 2009
1 parent fb1715d commit 7945408
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/test_all.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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", {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7945408

Please sign in to comment.