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 tests
Previously, 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.
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.