redding / assert

Assertion style testing framework.
https://github.com/redding/assert
MIT License
10 stars 1 forks source link

include diffs in `assert_equal` fail message output #156

Closed kellyredding closed 10 years ago

kellyredding commented 10 years ago

This adds utilities/behavior to use diff output (when appropriate) in assert_equal fail messages.

All of the behavior is customizable. Set a custom use_diff_proc config value to control the conditions when diff output is used. By default, use_diff_proc is set to the default_use_diff_proc util which is true when either show output has newlines or is larger than 29 chars. Set a custom run_diff_proc config value to customize how the diff is generated. By default run_diff_proc uses the syscmd_diff_proc util which used the diff --unified=-1 syscmd to generate the diff output.

Diff output works with both standard and pretty print output.

Closes #144.

@jcredding ready for review

jcredding commented 10 years ago

@kellyredding - Nice, looks good to me :boom: