Sha256: d2bd4b0824f5129e899064effc1f6e7114396858354bac29e5e104075bb3b6e4

Contents?: true

Size: 751 Bytes

Versions: 2

Compression:

Stored size: 751 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

2 entries across 2 versions & 1 rubygems

Version Path
watir-webdriver-0.0.9 spec/watirspec/pres_spec.rb
watir-webdriver-0.0.8 spec/watirspec/pres_spec.rb