Skip to content

Commit db2edb9

Browse files
committed
(#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.
1 parent f2af275 commit db2edb9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spec/unit/puppet-strings/json_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class klass(Integer $param1, $param2, String $param3 = hi) inherits foo::bar {
2525
}
2626
SOURCE
2727

28+
# Puppet will not parse plans if Puppet[:tasks] is not enabled.
29+
Puppet[:tasks] = true if TEST_PUPPET_PLANS
2830
expect(YARD::Parser::SourceParser.parse_string(<<-SOURCE, :puppet).enumerator.length).to eq(1) if TEST_PUPPET_PLANS
2931
# A simple plan.
3032
# @param param1 First param.

0 commit comments

Comments
 (0)