Sha256: 1e56e81a336b56e13fa16da8a8e0f887a5f10bf757e7f5708ecd976b138113f2
Contents?: true
Size: 1.88 KB
Versions: 2
Compression:
Stored size: 1.88 KB
Contents
require File.join(File.dirname(__FILE__),'../../lib/ropenlayer.rb') describe Ropenlayer do describe Ropenlayer::Openlayer do describe Ropenlayer::Openlayer::Feature do before(:all) do @test_map = Ropenlayer::Openlayer::Map.new('test') @valid_options = { :id => 'test_feature', :geometry => 'POINT', :longitude => 0, :latitude => 0 } @render_options = @valid_options.merge({ :name => 'NOT another feature', :icon_url => '/example', :icon_size => [1,1], :popup_size => [1,1], :popup_content => 'hay' }) end it "should create a new instance given valid attributes. and obtaine default values" do feature = Ropenlayer::Openlayer::Feature.new(@test_map, @valid_options) feature.class.should == Ropenlayer::Openlayer::Feature feature.instance_variable_get("@name").should == 'Another Feature' feature.instance_variable_get("@icon_url").should == '/images/ropenlayer/default_marker.png' feature.instance_variable_get("@icon_size").should == [40, 34 ] feature.instance_variable_get("@popup_size").should == [ 600, 400 ] feature.instance_variable_get("@popup_content").should == false end it "should have recognize changes in render values" do feature = Ropenlayer::Openlayer::Feature.new(@test_map, @render_options) feature.class.should == Ropenlayer::Openlayer::Feature feature.instance_variable_get("@name").should == 'NOT another feature' feature.instance_variable_get("@icon_url").should == '/example' feature.instance_variable_get("@icon_size").should == [1, 1 ] feature.instance_variable_get("@popup_size").should == [ 1, 1 ] feature.instance_variable_get("@popup_content").should == 'hay' end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ropenlayer-0.3.5 | spec/ropenlayer/feature_spec.rb |
ropenlayer-0.3.4 | spec/ropenlayer/feature_spec.rb |