operawatir icon indicating copy to clipboard operation
operawatir copied to clipboard

watir 1 leaks - unexpected arrays

Open jarib opened this issue 14 years ago • 2 comments

./spec/legacy_watirspec/radio_spec.rb:174 fails with:

expected enabled? to return false, got [false, false, false, false, false]

./spec/legacy_watirspec/checkbox_spec.rb:216 fails with:

expected set? to return false, got [true, true, true, true, true, true, true]

./spec/legacy_watirspec/div_spec.rb:140 fails with:

browser.div(:xpath, "//div[@id='footer']").text.strip => undefined method `strip' for #<Array:0xb2945d>

./spec/legacy_watirspec/pre_spec.rb:68

expected: "rspec",
 got: ["rspec", ""] (using ==)

jarib avatar Dec 21 '10 12:12 jarib

This is a known issue. The method missing matcher is (I think) going to detect if the method ends in a question mark, and then call .all on the result if it does. That will fix the first two cases.

The third, however, still needs to be investigated. It could well be a bug.

chrislloyd avatar Dec 21 '10 21:12 chrislloyd

In the current Watir .id, .set? etc. return the value of the first element in the collection, and don't .all? them afaict.

f52a855c965fcb126eb2bbf0a3ac29e3897c9733 fixes this.

If you're happy jarib, please close.

Stuk avatar Dec 22 '10 14:12 Stuk