rspec-file_fixtures

0.1.9
Light Mode Dark Mode

XML

XML fixtures can be parsed into a Ruby Nokogiri::XML::Document object using the #from_yaml method.

Nokogiri is not a hard dependency of Rspec::FileFixtures so you must install and require Nokogiri yourself to use this feature.

subject { fixture('example.xml').from_xml }

it { is_expected.to be_a Nokogiri::XML::Document }
#(Document:0xf28 {
  name = "document",
  children = [
    #(Element:0xf3c {
      name = "thing",
      children = [
        #(Text "\n" + "  "),
        #(Element:0xf50 {
          name = "a",
          attribute_nodes = [
            #(Attr:0xf64 { name = "type", value = "integer" })],
          children = [ #(Text "1")]
          }),
        #(Text "\n")]
      })]
  })

Documentation generated by rspec-documentation