sethvargo/chefspec — pull request #390 by benesch (2014-03-16 18:13:22+00:00)
Title: render_file_matcher: support arbitrary RSpec matchers

Non-line-based configuration files (XML, JSON) are very hard to test
with simple string inclusion or regular expressions. Empower the
`render_file_matcher` to validate a template's content against any
arbitrary RSpec matcher.

This allows external libraries to drop in support for, say, an XPath
matcher

expect(template).to render_file('/foo').with_content(
xml_with_xpath("configuration/property[value='foo']")
)

without either a) cluttering up ChefSpec core or b) re-implementing the
logic of `render_file`.