Require English so we can use $LAST_MATCH_INFO instead of $~

This commit is contained in:
Bryan Helmkamp 2009-06-15 00:08:25 -04:00
parent 6720bbb476
commit 9b971a15c0
1 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
require "webrat/core_extensions/blank"
require "English"
require "webrat/core_extensions/blank"
require "webrat/core/elements/element"
module Webrat
@ -53,7 +54,7 @@ module Webrat
def authenticity_token
return unless onclick && onclick.include?("s.setAttribute('name', 'authenticity_token');") &&
onclick =~ /s\.setAttribute\('value', '([a-f0-9]{40})'\);/
$~.captures.first
$LAST_MATCH_INFO.captures.first
end
def onclick