RSpec: implement gomplate testing patterns throughout
Summary
Following #3366 (closed), we can now test gomplate content directly as rendered. We should evaluate all instances of RSpec testing gomplate content, for the need to test the result, or simply the presence within the gomplate string content.
Description
Currently, there is a mix of direct YAML.safe_load()
of gomplate content, and direct to contain()
string comparison. We should evaluate each instance of any test of gomplate, determining if it should be an evaluation of the final content as YAML, or a specific match to the content of the gomplate template itself (via string comparators).
Any instance which should be a YAML evaluation should be translated to make use of RuntimeTemplate.gomplate
from the recently added (!3289 (merged)) spec/runtime_template_helper.rb
.
Process
- Identify all instances (listing of all RSpec files doing this)
- Determine appropriate check for each instance within each file
- Replace those as necessary, as a single RSpec file per MR to keep reviews small
- Replace any prior implementations of gomplate rendering
Acceptance Criteria
-
All uses of RSpec on gomplate content have been evaluated for replacement -
All instances of such gomplate have been updated to make use of RuntimeTemplate.gomplate
as appropriate. -
Any instances of prior implementation are removed (!3098 (merged), !3151 (merged))