File: image_spec.rb

package info (click to toggle)
ruby-rubyvis 0.6.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 1,808 kB
  • ctags: 679
  • sloc: ruby: 11,114; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 597 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
describe Rubyvis::Image do

  include Rubyvis::GeneralSpec

  it "Rubyvis.Image be the same as Rubyvis::Image" do
    Rubyvis.Image.should eql Rubyvis::Image
  end
  
  it "should render correctly" do
    w = 400
    h = 400
    
    vis = Rubyvis::Panel.new().
      width(w).
      height(h).
      margin(20).
      stroke_style("#ccc");
    
    vis.add(Rubyvis::Image).url('fixtures/tipsy.gif')
    vis.render()
    
    pv_out=fixture_svg_read("image.svg")
    vis.to_svg.should have_same_svg_elements(pv_out)
  end
   
end