Replace regexp with include? ... more readable

This commit is contained in:
Jonas Nicklas 2009-11-30 21:50:40 +01:00
parent 4363452f6d
commit e71d66b791
1 changed files with 1 additions and 1 deletions

View File

@ -199,7 +199,7 @@ module Capybara
end
def sanitized_xpath_string(string)
if string =~ /'/
if string.include?("'")
string = string.split("'", -1).map do |substr|
"'#{substr}'"
end.join(%q{,"'",})