Sha256: 8b31b306b6b3499ee6688b6fa331c7b2a1600aec27dcda2e845e57552aace9f1

Contents?: true

Size: 833 Bytes

Versions: 1

Compression:

Stored size: 833 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper.rb'

describe "Pres" do

  before :all do
    @browser = Browser.new(BROWSER_OPTIONS)
  end

  before :each do
    @browser.goto(HTML_DIR + "/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[2].id.should == "rspec"
    end
  end

  describe "#each" do
    it "iterates through pres correctly" do
      @browser.pres.each_with_index do |p, index|
        p.name.should == @browser.pre(:index, index+1).name
        p.id.should == @browser.pre(:index, index+1).id
        p.value.should == @browser.pre(:index, index+1).value
      end
    end
  end

  after :all do
    @browser.close
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caius-celerity-0.0.6.11 spec/pres_spec.rb