Use assert_template_result & assert_match_syntax_error in more places #1611
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.
Problem
The test/integration folder is meant to be a set of tests that can be shared with other liquid implementations, initially used with liquid-c. However, it still has coupling to the liquid library API, which could be further reduced.
Solution
Use assert_template_result & assert_match_syntax_error in more places, since they are more decoupled from the liquid library API.
Follow-up Work
There were tests that couldn't be converted with the current assert_template_result & assert_match_syntax_error interface, since they require additional options to be supported. For instance, there is a need to specify the file system, error mode and to render liquid errors. Once that is done, more integration tests can be decoupled from the library API.
I've also deferred the conversion of the standard library tests, which could use another help method to properly test the filter results, taking into account the type of the result.
I also noticed there were tests that are coupled to the liquid library API, which still need to be moved out of the test/integration folder to keep them separate.