(#307) Fix plan parsing in JSON spec tests #311
Closed
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.
This is 3 closely related commits. I’m not totally satisfied with this solution — I would be inclined to set
Puppet[:tasks] = true
regardless of the file name, but I’m not really sure what all the implications would be.Catch parse failures in
PuppetStrings::Json
testsPreviously, the tests for
PuppetStrings::Json
(in json_spec.rb) parsed a variety of code samples and then queried YARD to test the results. If a sample failed to parse, an error might be outputted (see issue #307), but no failure was registered by the testing harness.This adds simple checks to verify that the parses actually succeed.
Unfortunately, one of the samples currently fails to parse, so this commit introduces a testing error. The subbsequent commit will fix it.
(#307) Fix plan parsing in JSON spec tests
Previously, parsing of Puppet plan code failed in json_spec.rb because it didn’t provide a file name to the parser, which prevented the parser from enabling task support in Puppet, which prevented the parser from recognizing a plan.
This turns on task support in Puppet before trying to parse a plan in json_spec.rb.
Add a plan test to parser_spec.rb
Previously, none of the examples in parser_spec.rb included a Puppet plan. This adds a plan and verifies that it parses correctly.