Sha256: 144d78631ba83d708ea415dadeea350739a78df24089555b1a1cc720fcf417ce
Contents?: true
Size: 567 Bytes
Versions: 44
Compression:
Stored size: 567 Bytes
Contents
module Webrat def self.rexml_document(stringlike) stringlike = stringlike.body.to_s if stringlike.respond_to?(:body) case stringlike when REXML::Document stringlike.root when REXML::Node, Array stringlike else begin REXML::Document.new(stringlike.to_s).root rescue REXML::ParseException => e if e.message.include?("second root element") REXML::Document.new("<fake-root-element>#{stringlike}</fake-root-element>").root else raise e end end end end end
Version data entries
44 entries across 44 versions & 14 rubygems