File: test_graph.rb

package info (click to toggle)
ruby-svg-graph 2.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,312 kB
  • sloc: javascript: 23,548; ruby: 4,234; xml: 224; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 415 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'test/unit'
require 'svggraph'

class TestGraph < Test::Unit::TestCase
  class DummyGraph < SVG::Graph::Graph
    def get_css; end
    def draw_data; end

    def get_x_labels
      []
    end
    def get_y_labels
      []
    end
  end
  
  def test_to_iruby
    graph = DummyGraph.new({})
    graph.add_data({ data: [1,2,3] })
    assert_equal graph.to_iruby, ["text/html", graph.burn_svg_only]
  end
end