Sha256: 4537a98968755c6410b45decad552694a1463338cbc3921532d1a171c7e7ee53

Contents?: true

Size: 855 Bytes

Versions: 15

Compression:

Stored size: 855 Bytes

Contents

require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
describe "Rubyvis Readme" do
  it "should work with RBP API" do
    vis=nil
    lambda {
    vis = Rubyvis::Panel.new do 
      width 150
      height 150
      bar do
        data [1, 1.2, 1.7, 1.5, 0.7, 0.3]
        width 20
        height {|d| d * 80}
        bottom(0)
        left {index * 25}
      end
    end
    
    vis.render}.should_not raise_exception
    vis.to_svg.size.should>0
  end
  it "should work with Protovis API" do
    vis=nil
    lambda {
    vis = Rubyvis::Panel.new.width(150).height(150);
    
    vis.add(pv.Bar).
      data([1, 1.2, 1.7, 1.5, 0.7, 0.3]).
      width(20).
      height(lambda {|d| d * 80}).
      bottom(0).
      left(lambda {self.index * 25});
    
    vis.render
    }.should_not raise_exception
    vis.to_svg.size.should>0
  end
  
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rubyvis-0.6.1 spec/readme_spec.rb
rubyvis-0.6.0 spec/readme_spec.rb
rubyvis-0.5.2 spec/readme_spec.rb
rubyvis-0.5.1 spec/readme_spec.rb
rubyvis-0.5.0 spec/readme_spec.rb
rubyvis-0.4.1 spec/readme_spec.rb
rubyvis-0.4.0 spec/readme_spec.rb
rubyvis-0.3.6 spec/readme_spec.rb
rubyvis-0.3.5 spec/readme_spec.rb
rubyvis-0.3.4 spec/readme_spec.rb
rubyvis-0.3.3 spec/readme_spec.rb
rubyvis-0.3.2 spec/readme_spec.rb
rubyvis-0.3.1 spec/readme_spec.rb
rubyvis-0.3.0 spec/readme_spec.rb
rubyvis-0.2.2 spec/readme_spec.rb