Sha256: 0f515e21df12d5d15c83ebf9ae39578b06a651457911eec53162e1630c6e9e67

Contents?: true

Size: 794 Bytes

Versions: 25

Compression:

Stored size: 794 Bytes

Contents

# encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)

describe "Maps" do

  before :each do
    browser.goto(WatirSpec.files + "/images.html")
  end

  describe "#length" do
    it "returns the number of maps" do
      browser.maps.length.should == 2
    end
  end

  describe "#[]" do
    it "returns the p at the given index" do
      browser.maps[1].id.should == "triangle_map"
    end
  end

  describe "#each" do
    it "iterates through maps correctly" do
      count = 0

      browser.maps.each_with_index do |m, index|
        m.name.should == browser.map(:index, index+1).name
        m.id.should == browser.map(:index, index+1).id
        m.value.should == browser.map(:index, index+1).value

        count += 1
      end

      count.should > 0
    end
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
operawatir-0.7.pre4-jruby spec/watir2/maps_spec.rb
operawatir-0.7.pre3-jruby spec/watir2/maps_spec.rb
operawatir-0.7.pre2-jruby spec/watir2/maps_spec.rb
operawatir-0.7.pre1-jruby spec/watir2/maps_spec.rb
operawatir-0.6.pre1-jruby spec/watir2/maps_spec.rb
operawatir-0.5.1-jruby spec/watir2/maps_spec.rb
operawatir-0.5-jruby spec/watir2/maps_spec.rb
operawatir-0.5.pre3-jruby spec/watir2/maps_spec.rb
operawatir-0.5.pre2-jruby spec/watir2/maps_spec.rb
operawatir-0.5.pre1-jruby spec/watir2/maps_spec.rb
operawatir-0.4.3.pre1-jruby spec/watir2/maps_spec.rb
operawatir-0.4.2-jruby spec/watir2/maps_spec.rb
operawatir-0.4.1-jruby spec/watir2/maps_spec.rb
operawatir-0.4.1.pre7-jruby spec/watir2/maps_spec.rb
operawatir-0.4.1.pre6-jruby spec/watir2/maps_spec.rb
operawatir-0.4.1.pre5-jruby spec/watir2/maps_spec.rb
operawatir-0.4.1.pre4-jruby spec/watir2/maps_spec.rb
operawatir-0.4.1.pre3-jruby spec/watir2/maps_spec.rb
operawatir-0.4.1.pre2-jruby spec/watir2/maps_spec.rb
operawatir-0.4.1.pre1-jruby spec/watir2/maps_spec.rb