spec/watirspec/hns_spec.rb in watir-webdriver-0.0.6 vs spec/watirspec/hns_spec.rb in watir-webdriver-0.0.7

- old
+ new

@@ -1,38 +1,34 @@ # encoding: utf-8 -require File.dirname(__FILE__) + '/spec_helper' +require File.expand_path('spec_helper', File.dirname(__FILE__)) -bug "WTR-345", :watir do +describe "H1s", "H2s", "H3s", "H4s", "H5s", "H6s" do + before :each do + browser.goto(WatirSpec.files + "/non_control_elements.html") + end - describe "H1s", "H2s", "H3s", "H4s", "H5s", "H6s" do - before :each do - browser.goto(WatirSpec.files + "/non_control_elements.html") + describe "#length" do + it "returns the number of h1s" do + browser.h2s.length.should == 9 end + end - describe "#length" do - it "returns the number of h1s" do - browser.h2s.length.should == 9 - end + describe "#[]" do + it "returns the h1 at the given index" do + browser.h1s[0].id.should == "first_header" end + end - describe "#[]" do - it "returns the h1 at the given index" do - browser.h1s[0].id.should == "first_header" - end - end - - describe "#each" do - it "iterates through header collections correctly" do - lengths = (1..6).collect do |i| - collection = browser.send(:"h#{i}s") - collection.each_with_index do |h, index| - h.id.should == browser.send(:"h#{i}", :index, index).id - h.value.should == browser.send(:"h#{i}", :index, index).value - end - collection.length + describe "#each" do + it "iterates through header collections correctly" do + lengths = (1..6).collect do |i| + collection = browser.send(:"h#{i}s") + collection.each_with_index do |h, index| + h.id.should == browser.send(:"h#{i}", :index, index).id + h.value.should == browser.send(:"h#{i}", :index, index).value end - lengths.should == [2, 9, 2, 1, 1, 2] + collection.length end + lengths.should == [2, 9, 2, 1, 1, 2] end end - -end \ No newline at end of file +end