Added the Gruff library to the lib/ directory of the the rails folder, and the
[selectricity] / lib / gruff-0.2.8 / test / test_photo.rb
diff --git a/lib/gruff-0.2.8/test/test_photo.rb b/lib/gruff-0.2.8/test/test_photo.rb
new file mode 100644 (file)
index 0000000..32415aa
--- /dev/null
@@ -0,0 +1,41 @@
+#!/usr/bin/ruby
+
+require File.dirname(__FILE__) + "/gruff_test_case"
+
+class TestGruffPhotoBar < GruffTestCase
+
+#   def setup
+#     @datasets = [
+#       [:Jimmy, [25, 36, 86, 39]],
+#       [:Charles, [80, 54, 67, 54]],
+# #      [:Charity, [0, nil, 100, 90]],
+#       ]
+#   end
+# 
+#   def test_bar_graph
+#     bar_graph_sized
+#     bar_graph_sized(400)
+#   end
+# 
+# 
+# protected
+# 
+#   def bar_graph_sized(size=800)
+#     g = Gruff::PhotoBar.new(size)
+#     g.title = "Photo Bar Graph Test #{size}px"
+#     g.labels = {
+#       0 => '5/6', 
+#       1 => '5/15', 
+#       2 => '5/24', 
+#       3 => '5/30', 
+#     }
+#     @datasets.each do |data|
+#       g.data(*data)
+#     end
+# 
+#     g.theme = 'plastik'
+# 
+#     g.write("test/output/photo_plastik_#{size}.png")    
+#   end
+
+end

Benjamin Mako Hill || Want to submit a patch?