Sha256: 207211391cf59c4bdb88bd5a40427a2162df91313b0a5680be975978804cdc68
Contents?: true
Size: 738 Bytes
Versions: 8
Compression:
Stored size: 738 Bytes
Contents
require 'test_helper' require 'rmagick' class BumpsparkTest < Test::Unit::TestCase context "generating pngs" do should "work for an empty bumpspark" do assert_valid_png [] end should "work for a bumpspark with one datapoint" do assert_valid_png [1] end should "work for a bumpspark with multiple datapoints" do assert_valid_png [1, 2, 3] end end def assert_valid_png(data) image = Magick::Image.from_blob(generate(data)).first assert image, "No valid image generated" assert_equal "image/png", image.mime_type, "Image has wrong mime type" end def generate(data, format=:png) Bumpspark::Graph.new(data).send("to_#{format}") end end
Version data entries
8 entries across 8 versions & 2 rubygems