spec/watirspec/elements/ol_spec.rb in watir-6.9.1 vs spec/watirspec/elements/ol_spec.rb in watir-6.10.0
- old
+ new
@@ -21,33 +21,31 @@
it "returns false if the 'ol' doesn't exist" do
expect(browser.ol(id: "no_such_id")).to_not exist
expect(browser.ol(id: /no_such_id/)).to_not exist
expect(browser.ol(text: "no_such_text")).to_not exist
- expect(browser.ol(text: /no_such_text/)).to_not exist
+ msg = /:text locator with RegExp values to find elements based on only visible text is deprecated. Use :visible_text instead./
+ expect { expect(browser.ol(text: /no_such_text/)).to_not exist }.to output(msg).to_stdout_from_any_process
expect(browser.ol(class: "no_such_class")).to_not exist
expect(browser.ol(class: /no_such_class/)).to_not exist
expect(browser.ol(index: 1337)).to_not exist
expect(browser.ol(xpath: "//ol[@id='no_such_id']")).to_not exist
end
it "returns false if the 'ol' doesn't exist" do
expect(browser.ol(id: "no_such_id")).to_not exist
expect(browser.ol(id: /no_such_id/)).to_not exist
expect(browser.ol(text: "no_such_text")).to_not exist
- expect(browser.ol(text: /no_such_text/)).to_not exist
+ msg = /:text locator with RegExp values to find elements based on only visible text is deprecated. Use :visible_text instead./
+ expect { expect(browser.ol(text: /no_such_text/)).to_not exist }.to output(msg).to_stdout_from_any_process
expect(browser.ol(class: "no_such_class")).to_not exist
expect(browser.ol(class: /no_such_class/)).to_not exist
expect(browser.ol(index: 1337)).to_not exist
expect(browser.ol(xpath: "//ol[@id='no_such_id']")).to_not exist
end
it "raises TypeError when 'what' argument is invalid" do
expect { browser.ol(id: 3.14).exists? }.to raise_error(TypeError)
- end
-
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
- expect { browser.ol(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
end
end
# Attribute methods
describe "#class_name" do