spec/watirspec/elements/divs_spec.rb in watir-6.11.0 vs spec/watirspec/elements/divs_spec.rb in watir-6.12.0

- old
+ new

@@ -20,9 +20,21 @@ describe "#[]" do it "returns the div at the given index" do expect(browser.divs[1].id).to eq "outer_container" end + + it "returns an array of divs with a given range of positive values" do + divs = browser.divs[2..4] + ids = divs.map(&:id) + expect(ids).to eq %w(header promo content) + end + + it "returns an array of divs with a given range including negative values" do + divs = browser.divs[11..-3] + ids = divs.map(&:id) + expect(ids).to eq %w(messages ins_tag_test del_tag_test) + end end describe "#each" do it "iterates through divs correctly" do count = 0