Moving require of nokogiri to webrat.rb
This commit is contained in:
parent
c01f44a32c
commit
e5b0e77332
|
@ -10,6 +10,18 @@ module Webrat
|
|||
end
|
||||
end
|
||||
|
||||
# We need Nokogiri's CSS to XPath support, even if using REXML
|
||||
require "nokogiri/css"
|
||||
|
||||
# Require nokogiri and fall back on rexml
|
||||
begin
|
||||
require "nokogiri"
|
||||
require "webrat/core/nokogiri"
|
||||
rescue LoadError => e
|
||||
require "rexml/document"
|
||||
warn("Standard REXML library is slow. Please consider installing nokogiri.\nUse \"sudo gem install nokogiri\"")
|
||||
end
|
||||
|
||||
require "webrat/core"
|
||||
|
||||
# TODO: This is probably not a good idea.
|
||||
|
|
|
@ -3,17 +3,6 @@ module Webrat
|
|||
|
||||
class HasContent
|
||||
def initialize(content)
|
||||
# We need Nokogiri's CSS to XPath support, even if using REXML
|
||||
require "nokogiri/css"
|
||||
|
||||
begin
|
||||
require "nokogiri"
|
||||
require "webrat/core/nokogiri"
|
||||
rescue LoadError => e
|
||||
require "rexml/document"
|
||||
warn("Standard REXML library is slow. Please consider installing nokogiri.\nUse \"sudo gem install nokogiri\"")
|
||||
end
|
||||
|
||||
@content = content
|
||||
end
|
||||
|
||||
|
|
|
@ -3,18 +3,6 @@ module Webrat
|
|||
|
||||
class HaveXpath
|
||||
def initialize(expected, &block)
|
||||
# We need Nokogiri's CSS to XPath support, even if using REXML
|
||||
require "nokogiri/css"
|
||||
|
||||
# Require nokogiri and fall back on rexml
|
||||
begin
|
||||
require "nokogiri"
|
||||
require "webrat/core/nokogiri"
|
||||
rescue LoadError => e
|
||||
require "rexml/document"
|
||||
warn("Standard REXML library is slow. Please consider installing nokogiri.\nUse \"sudo gem install nokogiri\"")
|
||||
end
|
||||
|
||||
@expected = expected
|
||||
@block = block
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue