Captures proc output instead of calling it #17
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A specific bug occurs with TodoList specs where the proc that is captured by the exception refers to a portion of the code which returns an array but outputs a string.
This array causes issues when showing the HTML diff:
To solve this, I capture the output of the proc instead of calling it.
Testing
Test this using the following script (add it to the root of this repository):
Both cases should return an actual that is a string — not an array.
Learn Output
The specs on Learn now look like this:
When the spec fails:

When the spec passes:

Important
Capture
Procoutput tostdoutinserialize_valueand add tests for output matchers.serialize_valueinExpectationHelperWrapperto captureProcoutput tostdoutinstead of calling it directly.demo.rb.Procserialization test inoj_serialization_spec.rb.stdout_matcher_spec.rbto test capturing ofstdoutoutput for passing and failing cases.0.8.3inversion.rb.This description was created by
for 28c7483. You can customize this summary. It will automatically update as commits are pushed.