Sha256: 4461c9880d051a16a9e728e92526a425d3888bb8f56b797831550b44612dca8a

Contents?: true

Size: 718 Bytes

Versions: 4

Compression:

Stored size: 718 Bytes

Contents

require 'ostruct'
require 'rubygems'
require 'pathname'
require 'ostruct'
require 'rspec/matchers' # req by equivalent-xml custom matcher `be_equivalent_to`
require 'equivalent-xml'

require_relative './../test/support/fixtures'
require_relative './../lib/roxml'
require_relative './shared_specs'

def xml_for(name)
  Pathname.new(File.dirname(__FILE__)).expand_path.dirname.join("examples/xml/#{name}.xml")
end

class RoxmlObject
  include ROXML
end

# returns an array representing the path  through first child of each element in the doc
def xml_path(xml, path = [])
  path << xml.name if xml.is_a?(Nokogiri::XML::Element)
  unless xml.children.empty?
    xml_path(xml.children.first, path)
  end
  return path
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
roxml-4.2.0 spec/spec_helper.rb
roxml-4.1.1 spec/spec_helper.rb
roxml-4.1.0 spec/spec_helper.rb
roxml-4.0.0 spec/spec_helper.rb