Sha256: b9d8cb8ba227106c63e792601211eeab7e4f561be6623e27c2a0981f2fbbd73a

Contents?: true

Size: 1.23 KB

Versions: 19

Compression:

Stored size: 1.23 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. spec_helper]))

describe Ziya::Gauges::Support::RadialNumbers do
  before( :each ) do
    @comp = Ziya::Gauges::Support::RadialNumbers.new(
      :x           => 10,
      :y           => 10,
      :radius      => 200,
      :start_num   => 1,
      :end_num     => 10,
      :start_angle => 0,
      :end_angle   => 180,
      :ticks       => 10,
      :font        => "arial",
      :bold        => "false",
      :align       => "left",
      :width       => 100,
      :height      => 100,
      :size        => 10,
      :color       => "ffffff" )
  end
  
  describe "#flatten" do  
    it "should flatten component correctly" do
      xml = Builder::XmlMarkup.new
      @comp.flatten( xml )
      buff = xml.to_s   
      buff.scan( /<text/ ).size.should == 10
      buff.scan( /x=\"(.*?\d+)\"/ ).should == [ ["10"], ["78"], ["138"], ["183"], ["206"], ["206"], ["183"], ["138"], ["78"], ["10"] ]
      buff.scan( /y=\"(.*?\d+)\"/ ).should == [ ["-190"], ["-177"], ["-143"], ["-90"], ["-24"], ["44"], ["109"], ["163"], ["197"], ["210"] ]
      buff.scan( />(\d+)<\/text>/ ).should == [ ["1"], ["2"], ["3"], ["4"], ["5"], ["6"], ["7"], ["8"], ["9"], ["10"] ]
    end
        
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
derailed-ziya-2.0.4 spec/gauges/support/radial_numbers_spec.rb
derailed-ziya-2.0.6 spec/gauges/support/radial_numbers_spec.rb
derailed-ziya-2.0.8 spec/gauges/support/radial_numbers_spec.rb
derailed-ziya-2.1.0 spec/gauges/support/radial_numbers_spec.rb
derailed-ziya-2.1.1 spec/gauges/support/radial_numbers_spec.rb
derailed-ziya-2.1.2 spec/gauges/support/radial_numbers_spec.rb
derailed-ziya-2.1.3 spec/gauges/support/radial_numbers_spec.rb
derailed-ziya-2.1.4 spec/gauges/support/radial_numbers_spec.rb
derailed-ziya-2.1.5 spec/gauges/support/radial_numbers_spec.rb
ziya-2.1.7 spec/gauges/support/radial_numbers_spec.rb
ziya-2.1.6 spec/gauges/support/radial_numbers_spec.rb
ziya-2.0.0 spec/gauges/support/radial_numbers_spec.rb
ziya-2.0.2 spec/gauges/support/radial_numbers_spec.rb
ziya-2.0.1 spec/gauges/support/radial_numbers_spec.rb
ziya-2.0.5 spec/gauges/support/radial_numbers_spec.rb
ziya-2.0.4 spec/gauges/support/radial_numbers_spec.rb
ziya-2.0.3 spec/gauges/support/radial_numbers_spec.rb
ziya-2.0.7 spec/gauges/support/radial_numbers_spec.rb
ziya-2.0.6 spec/gauges/support/radial_numbers_spec.rb