1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

just assign regexps

This commit is contained in:
Thomas Walpole 2017-03-01 09:45:47 -08:00
parent 866c975076
commit 2a0d50cb57

View file

@ -57,7 +57,7 @@ module Capybara
options[:text]
else
if exact_text == true
"\\A#{Regexp.escape(options[:text].to_s)}\\z"
/\A#{Regexp.escape(options[:text].to_s)}\z/
else
Regexp.escape(options[:text].to_s)
end
@ -68,7 +68,7 @@ module Capybara
end
if exact_text.is_a?(String)
regexp = "\\A#{Regexp.escape(options[:exact_text])}\\z"
regexp = /\A#{Regexp.escape(options[:exact_text])}\z/
text_visible = visible
text_visible = :all if text_visible == :hidden
return false if not node.text(text_visible).match(regexp)