Sha256: 3cad9a39495e0d90dc3125587b8dd6d65c73711846fdc5023a8603b073d99010

Contents?: true

Size: 745 Bytes

Versions: 1

Compression:

Stored size: 745 Bytes

Contents

# encoding: utf-8
require File.expand_path('spec_helper', File.dirname(__FILE__))

describe "Pres" do

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

  describe "#length" do
    it "returns the number of pres" do
      browser.pres.length.should == 7
    end
  end

  describe "#[]" do
    it "returns the pre at the given index" do
      browser.pres[1].id.should == "rspec"
    end
  end

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

      browser.pres.each_with_index do |p, index|
        p.id.should == browser.pre(:index, index).id
        p.value.should == browser.pre(:index, index).value

		count += 1
      end

      count.should > 0
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir-webdriver-0.0.7 spec/watirspec/pres_spec.rb