rspec-documentation

0.0.11
Light Mode Dark Mode

XML

If your code outputs XML, use the ```rspec:xml formatter to prettify your XML output. Note that your code must produce a raw XML string in order to use this formatter, it does not convert Ruby objects into XML.

Markdown

```rspec:xml
subject(:xml) { '<?xml version="1.0" encoding="UTF-8"?><foo><bar>baz</bar></foo>' }

it 'has expected key/value' do
  expect(Nokogiri::XML.parse(xml).xpath('//foo/bar').text).to eql 'baz'
end
```

Output

subject(:xml) { '<?xml version="1.0" encoding="UTF-8"?><foo><bar>baz</bar></foo>' }

it 'has expected key/value' do
  expect(Nokogiri::XML.parse(xml).xpath('//foo/bar').text).to eql 'baz'
end
<?xml version="1.0" encoding="UTF-8"?>
<foo>
  <bar>baz</bar>
</foo>

Documentation generated by rspec-documentation