Sha256: 95cc62d9ce410f90e02ddf269d70a6eaf2041a720c222e7f384858fdd927c563

Contents?: true

Size: 1.38 KB

Versions: 8

Compression:

Stored size: 1.38 KB

Contents

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

describe Ziya::Maps::Support::HeatRange do
  before( :all ) do
    @comp = Ziya::Maps::Support::HeatRange.new(
      :base_color => "ff00ff",
      :min        => 0,
      :max        => 100,
      :step       => 10,
      :color_step => 90 )
  end
  
  describe "#flatten" do  
    it "should flatten component correctly" do
      xml = Builder::XmlMarkup.new
      @comp.flatten( xml )
      xml.should == '<state id="range"><data>0 - 9</data><color>ff00ff</color></state><state id="range"><data>60 - 69</data><color>880088</color></state><state id="range"><data>50 - 59</data><color>970097</color></state><state id="range"><data>40 - 49</data><color>a700a7</color></state><state id="range"><data>90 - 99</data><color>630063</color></state><state id="range"><data>80 - 89</data><color>6e006e</color></state><state id="range"><data>70 - 79</data><color>7a007a</color></state><state id="range"><data>30 - 39</data><color>ba00ba</color></state><state id="range"><data>20 - 29</data><color>cf00cf</color></state><state id="range"><data>10 - 19</data><color>e600e6</color></state>'      
    end
  end
  
  describe "YAML load" do
    it "should load from yaml correctly" do
      comp = YAML.load( @comp.to_yaml )
      @comp.options.each_pair do |k,v|
        comp.send( k ).to_s.should == v.to_s
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
derailed-ziya-2.1.0 spec/maps/support/heat_range_spec.rb
derailed-ziya-2.1.1 spec/maps/support/heat_range_spec.rb
derailed-ziya-2.1.2 spec/maps/support/heat_range_spec.rb
derailed-ziya-2.1.3 spec/maps/support/heat_range_spec.rb
derailed-ziya-2.1.4 spec/maps/support/heat_range_spec.rb
derailed-ziya-2.1.5 spec/maps/support/heat_range_spec.rb
ziya-2.1.7 spec/maps/support/heat_range_spec.rb
ziya-2.1.6 spec/maps/support/heat_range_spec.rb