operawatir
operawatir copied to clipboard
watir 1 leaks - unexpected arrays
./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 ==)
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.
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.