spec/unit/selector_builder/element_spec.rb in watir-6.16.0 vs spec/unit/selector_builder/element_spec.rb in watir-6.16.1
- old
+ new
@@ -93,16 +93,17 @@
built = {xpath: ".//*[contains(concat(' ', @class, ' '), ' user ')]"}
expect(selector_builder.build(selector)).to eq built
end
- # TODO: This functionality is deprecated with "class_array"
it 'values with spaces' do
selector = {class_name: 'multiple classes here'}
built = {xpath: ".//*[contains(concat(' ', @class, ' '), ' multiple classes here ')]"}
- expect(selector_builder.build(selector)).to eq built
+ expect {
+ expect(selector_builder.build(selector)).to eq built
+ }.to have_deprecated_class_array
end
it 'single String concatenates' do
selector = {class: 'user'}
built = {xpath: ".//*[contains(concat(' ', @class, ' '), ' user ')]"}
@@ -278,15 +279,16 @@
built = {xpath: ".//*[normalize-space()='Add user']"}
expect(selector_builder.build(selector)).to eq built
end
- # Deprecated with :caption
it 'with caption attribute' do
selector = {caption: 'Add user'}
built = {xpath: ".//*[normalize-space()='Add user']"}
- expect(selector_builder.build(selector)).to eq built
+ expect {
+ expect(selector_builder.build(selector)).to eq built
+ }.to have_deprecated_caption
end
it 'raises exception when text is not a String or Regexp' do
selector = {text: 7}
msg = /expected one of \[String, Regexp\], got 7:(Fixnum|Integer)/