cucumber/aruba — Issue #109: HTML file contents matching
Author: samwgoldman
Created: 2012-02-21 23:10:09+00:00
State: open

I have a custom RSpec formatter that outputs HTML files, and I would like to write an integration test around this using aruba.

This is currently possible using the assert_file_contents matcher, but for this specific case the matcher has a too-narrow view of what does and does not match.

The least amount that I need to make this matcher work for me is this: if the matcher could ignore differences in white space that is at the beginning and end of the lines of both the expected content and the actual content.

A more sophisticated approach would be to canonicalize the HTML before comparing. This could also be useful for other formats, but seems much more domain-specific.

To solve this problem, I am currently defining my own step that ignores the whitespace.

Would a patch that added this functionality be considered for inclusion? If so, I will write up a PR.