(PDOC-125) Update JSON tests for `signatures` key
This commit is contained in:
parent
6ad74b0500
commit
e4df165489
|
@ -84,7 +84,7 @@
|
||||||
{
|
{
|
||||||
"name": "database",
|
"name": "database",
|
||||||
"file": "(stdin)",
|
"file": "(stdin)",
|
||||||
"line": 45,
|
"line": 54,
|
||||||
"docstring": {
|
"docstring": {
|
||||||
"text": "An example database server resource type."
|
"text": "An example database server resource type."
|
||||||
},
|
},
|
||||||
|
@ -154,7 +154,7 @@
|
||||||
"name": "linux",
|
"name": "linux",
|
||||||
"type_name": "database",
|
"type_name": "database",
|
||||||
"file": "(stdin)",
|
"file": "(stdin)",
|
||||||
"line": 34,
|
"line": 43,
|
||||||
"docstring": {
|
"docstring": {
|
||||||
"text": "An example provider on Linux."
|
"text": "An example provider on Linux."
|
||||||
},
|
},
|
||||||
|
@ -195,7 +195,47 @@
|
||||||
"file": "(stdin)",
|
"file": "(stdin)",
|
||||||
"line": 6,
|
"line": 6,
|
||||||
"type": "puppet",
|
"type": "puppet",
|
||||||
"signature": "func(Integer $param1, Any $param2, String $param3 = hi)",
|
"signatures": [
|
||||||
|
{
|
||||||
|
"signature": "func(Integer $param1, Any $param2, String $param3 = hi)",
|
||||||
|
"docstring": {
|
||||||
|
"text": "A simple function.",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "First param.",
|
||||||
|
"types": [
|
||||||
|
"Integer"
|
||||||
|
],
|
||||||
|
"name": "param1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "Second param.",
|
||||||
|
"types": [
|
||||||
|
"Any"
|
||||||
|
],
|
||||||
|
"name": "param2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "Third param.",
|
||||||
|
"types": [
|
||||||
|
"String"
|
||||||
|
],
|
||||||
|
"name": "param3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "return",
|
||||||
|
"text": "Returns nothing.",
|
||||||
|
"types": [
|
||||||
|
"Undef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"docstring": {
|
"docstring": {
|
||||||
"text": "A simple function.",
|
"text": "A simple function.",
|
||||||
"tags": [
|
"tags": [
|
||||||
|
@ -242,7 +282,39 @@
|
||||||
"file": "(stdin)",
|
"file": "(stdin)",
|
||||||
"line": 1,
|
"line": 1,
|
||||||
"type": "ruby3x",
|
"type": "ruby3x",
|
||||||
"signature": "func3x(String $first, Any $second)",
|
"signatures": [
|
||||||
|
{
|
||||||
|
"signature": "func3x(String $first, Any $second)",
|
||||||
|
"docstring": {
|
||||||
|
"text": "An example 3.x function.",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The first parameter.",
|
||||||
|
"types": [
|
||||||
|
"String"
|
||||||
|
],
|
||||||
|
"name": "first"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The second parameter.",
|
||||||
|
"types": [
|
||||||
|
"Any"
|
||||||
|
],
|
||||||
|
"name": "second"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "return",
|
||||||
|
"text": "Returns nothing.",
|
||||||
|
"types": [
|
||||||
|
"Undef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"docstring": {
|
"docstring": {
|
||||||
"text": "An example 3.x function.",
|
"text": "An example 3.x function.",
|
||||||
"tags": [
|
"tags": [
|
||||||
|
@ -278,6 +350,78 @@
|
||||||
"file": "(stdin)",
|
"file": "(stdin)",
|
||||||
"line": 11,
|
"line": 11,
|
||||||
"type": "ruby4x",
|
"type": "ruby4x",
|
||||||
|
"signatures": [
|
||||||
|
{
|
||||||
|
"signature": "func4x(Integer $param1, Any $param2, Optional[Array[String]] $param3)",
|
||||||
|
"docstring": {
|
||||||
|
"text": "The first overload.",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The first parameter.",
|
||||||
|
"types": [
|
||||||
|
"Integer"
|
||||||
|
],
|
||||||
|
"name": "param1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The second parameter.",
|
||||||
|
"types": [
|
||||||
|
"Any"
|
||||||
|
],
|
||||||
|
"name": "param2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The third parameter.",
|
||||||
|
"types": [
|
||||||
|
"Optional[Array[String]]"
|
||||||
|
],
|
||||||
|
"name": "param3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "return",
|
||||||
|
"text": "Returns nothing.",
|
||||||
|
"types": [
|
||||||
|
"Undef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"signature": "func4x(Boolean $param, Callable &$block)",
|
||||||
|
"docstring": {
|
||||||
|
"text": "",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The first parameter.",
|
||||||
|
"types": [
|
||||||
|
"Boolean"
|
||||||
|
],
|
||||||
|
"name": "param"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The block parameter.",
|
||||||
|
"types": [
|
||||||
|
"Callable"
|
||||||
|
],
|
||||||
|
"name": "&block"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "return",
|
||||||
|
"text": "Returns a string.",
|
||||||
|
"types": [
|
||||||
|
"String"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"docstring": {
|
"docstring": {
|
||||||
"text": "An example 4.x function.",
|
"text": "An example 4.x function.",
|
||||||
"tags": [
|
"tags": [
|
||||||
|
@ -358,6 +502,58 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"source": "Puppet::Functions.create_function(:func4x) do\n # The first overload.\n # @param param1 The first parameter.\n # @param param2 The second parameter.\n # @param param3 The third parameter.\n # @return Returns nothing.\n dispatch :foo do\n param 'Integer', :param1\n param 'Any', :param2\n optional_param 'Array[String]', :param3\n return_type 'Undef'\n end\n\n # @param param The first parameter.\n # @param block The block parameter.\n # @return Returns a string.\n dispatch :other do\n param 'Boolean', :param\n block_param\n return_type 'String'\n end\nend"
|
"source": "Puppet::Functions.create_function(:func4x) do\n # The first overload.\n # @param param1 The first parameter.\n # @param param2 The second parameter.\n # @param param3 The third parameter.\n # @return Returns nothing.\n dispatch :foo do\n param 'Integer', :param1\n param 'Any', :param2\n optional_param 'Array[String]', :param3\n return_type 'Undef'\n end\n\n # @param param The first parameter.\n # @param block The block parameter.\n # @return Returns a string.\n dispatch :other do\n param 'Boolean', :param\n block_param\n return_type 'String'\n end\nend"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "func4x_1",
|
||||||
|
"file": "(stdin)",
|
||||||
|
"line": 35,
|
||||||
|
"type": "ruby4x",
|
||||||
|
"signatures": [
|
||||||
|
{
|
||||||
|
"signature": "func4x_1(Integer $param1)",
|
||||||
|
"docstring": {
|
||||||
|
"text": "An example 4.x function with only one signature.",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The first parameter.",
|
||||||
|
"types": [
|
||||||
|
"Integer"
|
||||||
|
],
|
||||||
|
"name": "param1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "return",
|
||||||
|
"text": "Returns nothing.",
|
||||||
|
"types": [
|
||||||
|
"Undef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"docstring": {
|
||||||
|
"text": "An example 4.x function with only one signature.",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The first parameter.",
|
||||||
|
"types": [
|
||||||
|
"Integer"
|
||||||
|
],
|
||||||
|
"name": "param1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "return",
|
||||||
|
"text": "Returns nothing.",
|
||||||
|
"types": [
|
||||||
|
"Undef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"source": "Puppet::Functions.create_function(:func4x_1) do\n # @param param1 The first parameter.\n # @return [Undef] Returns nothing.\n dispatch :foobarbaz do\n param 'Integer', :param1\n end\nend"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,6 +195,39 @@
|
||||||
"file": "(stdin)",
|
"file": "(stdin)",
|
||||||
"line": 1,
|
"line": 1,
|
||||||
"type": "ruby3x",
|
"type": "ruby3x",
|
||||||
|
"signatures": [
|
||||||
|
{
|
||||||
|
"signature": "func3x(String $first, Any $second)",
|
||||||
|
"docstring": {
|
||||||
|
"text": "An example 3.x function.",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The first parameter.",
|
||||||
|
"types": [
|
||||||
|
"String"
|
||||||
|
],
|
||||||
|
"name": "first"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The second parameter.",
|
||||||
|
"types": [
|
||||||
|
"Any"
|
||||||
|
],
|
||||||
|
"name": "second"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "return",
|
||||||
|
"text": "Returns nothing.",
|
||||||
|
"types": [
|
||||||
|
"Undef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"signature": "func3x(String $first, Any $second)",
|
"signature": "func3x(String $first, Any $second)",
|
||||||
"docstring": {
|
"docstring": {
|
||||||
"text": "An example 3.x function.",
|
"text": "An example 3.x function.",
|
||||||
|
@ -231,6 +264,78 @@
|
||||||
"file": "(stdin)",
|
"file": "(stdin)",
|
||||||
"line": 11,
|
"line": 11,
|
||||||
"type": "ruby4x",
|
"type": "ruby4x",
|
||||||
|
"signatures": [
|
||||||
|
{
|
||||||
|
"signature": "func4x(Integer $param1, Any $param2, Optional[Array[String]] $param3)",
|
||||||
|
"docstring": {
|
||||||
|
"text": "The first overload.",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The first parameter.",
|
||||||
|
"types": [
|
||||||
|
"Integer"
|
||||||
|
],
|
||||||
|
"name": "param1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The second parameter.",
|
||||||
|
"types": [
|
||||||
|
"Any"
|
||||||
|
],
|
||||||
|
"name": "param2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The third parameter.",
|
||||||
|
"types": [
|
||||||
|
"Optional[Array[String]]"
|
||||||
|
],
|
||||||
|
"name": "param3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "return",
|
||||||
|
"text": "Returns nothing.",
|
||||||
|
"types": [
|
||||||
|
"Undef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"signature": "func4x(Boolean $param, Callable &$block)",
|
||||||
|
"docstring": {
|
||||||
|
"text": "",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The first parameter.",
|
||||||
|
"types": [
|
||||||
|
"Boolean"
|
||||||
|
],
|
||||||
|
"name": "param"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The block parameter.",
|
||||||
|
"types": [
|
||||||
|
"Callable"
|
||||||
|
],
|
||||||
|
"name": "&block"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "return",
|
||||||
|
"text": "Returns a string.",
|
||||||
|
"types": [
|
||||||
|
"String"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"docstring": {
|
"docstring": {
|
||||||
"text": "An example 4.x function.",
|
"text": "An example 4.x function.",
|
||||||
"tags": [
|
"tags": [
|
||||||
|
@ -311,6 +416,58 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"source": "Puppet::Functions.create_function(:func4x) do\n # The first overload.\n # @param param1 The first parameter.\n # @param param2 The second parameter.\n # @param param3 The third parameter.\n # @return Returns nothing.\n dispatch :foo do\n param 'Integer', :param1\n param 'Any', :param2\n optional_param 'Array[String]', :param3\n return_type 'Undef'\n end\n\n # @param param The first parameter.\n # @param block The block parameter.\n # @return Returns a string.\n dispatch :other do\n param 'Boolean', :param\n block_param\n return_type 'String'\n end\nend"
|
"source": "Puppet::Functions.create_function(:func4x) do\n # The first overload.\n # @param param1 The first parameter.\n # @param param2 The second parameter.\n # @param param3 The third parameter.\n # @return Returns nothing.\n dispatch :foo do\n param 'Integer', :param1\n param 'Any', :param2\n optional_param 'Array[String]', :param3\n return_type 'Undef'\n end\n\n # @param param The first parameter.\n # @param block The block parameter.\n # @return Returns a string.\n dispatch :other do\n param 'Boolean', :param\n block_param\n return_type 'String'\n end\nend"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "func4x_1",
|
||||||
|
"file": "(stdin)",
|
||||||
|
"line": 35,
|
||||||
|
"type": "ruby4x",
|
||||||
|
"signatures": [
|
||||||
|
{
|
||||||
|
"signature": "func4x_1(Integer $param1)",
|
||||||
|
"docstring": {
|
||||||
|
"text": "An example 4.x function with only one signature.",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The first parameter.",
|
||||||
|
"types": [
|
||||||
|
"Integer"
|
||||||
|
],
|
||||||
|
"name": "param1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "return",
|
||||||
|
"text": "Returns nothing.",
|
||||||
|
"types": [
|
||||||
|
"Undef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"docstring": {
|
||||||
|
"text": "An example 4.x function with only one signature.",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag_name": "param",
|
||||||
|
"text": "The first parameter.",
|
||||||
|
"types": [
|
||||||
|
"Integer"
|
||||||
|
],
|
||||||
|
"name": "param1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag_name": "return",
|
||||||
|
"text": "Returns nothing.",
|
||||||
|
"types": [
|
||||||
|
"Undef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"source": "Puppet::Functions.create_function(:func4x_1) do\n # @param param1 The first parameter.\n # @return [Undef] Returns nothing.\n dispatch :foobarbaz do\n param 'Integer', :param1\n end\nend"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,15 @@ Puppet::Functions.create_function(:func4x) do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# An example 4.x function with only one signature.
|
||||||
|
Puppet::Functions.create_function(:func4x_1) do
|
||||||
|
# @param param1 The first parameter.
|
||||||
|
# @return [Undef] Returns nothing.
|
||||||
|
dispatch :foobarbaz do
|
||||||
|
param 'Integer', :param1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
Puppet::Type.type(:database).provide :linux do
|
Puppet::Type.type(:database).provide :linux do
|
||||||
desc 'An example provider on Linux.'
|
desc 'An example provider on Linux.'
|
||||||
confine kernel: 'Linux'
|
confine kernel: 'Linux'
|
||||||
|
|
Loading…
Reference in New Issue