prmd 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CONTRIBUTORS.md +11 -0
  4. data/README.md +21 -4
  5. data/bin/prmd +2 -2
  6. data/docs/schemata.md +4 -0
  7. data/lib/prmd/cli/base.rb +2 -2
  8. data/lib/prmd/cli/combine.rb +2 -2
  9. data/lib/prmd/cli/doc.rb +3 -3
  10. data/lib/prmd/cli/generate.rb +2 -2
  11. data/lib/prmd/cli/render.rb +2 -2
  12. data/lib/prmd/cli/verify.rb +2 -2
  13. data/lib/prmd/cli.rb +6 -6
  14. data/lib/prmd/commands/combine.rb +3 -3
  15. data/lib/prmd/commands/init.rb +2 -2
  16. data/lib/prmd/commands/render.rb +1 -1
  17. data/lib/prmd/commands.rb +4 -4
  18. data/lib/prmd/core/combiner.rb +6 -36
  19. data/lib/prmd/core/generator.rb +1 -1
  20. data/lib/prmd/core/reference_localizer.rb +93 -0
  21. data/lib/prmd/core/renderer.rb +1 -1
  22. data/lib/prmd/link.rb +56 -0
  23. data/lib/prmd/load_schema_file.rb +3 -14
  24. data/lib/prmd/multi_loader/json.rb +19 -0
  25. data/lib/prmd/multi_loader/loader.rb +128 -0
  26. data/lib/prmd/multi_loader/toml.rb +19 -0
  27. data/lib/prmd/multi_loader/yajl.rb +19 -0
  28. data/lib/prmd/multi_loader/yaml.rb +19 -0
  29. data/lib/prmd/multi_loader/yml.rb +2 -0
  30. data/lib/prmd/multi_loader.rb +2 -0
  31. data/lib/prmd/rake_tasks/base.rb +33 -5
  32. data/lib/prmd/rake_tasks/combine.rb +20 -4
  33. data/lib/prmd/rake_tasks/doc.rb +25 -8
  34. data/lib/prmd/rake_tasks/verify.rb +17 -5
  35. data/lib/prmd/schema.rb +24 -1
  36. data/lib/prmd/templates/combine_head.json +3 -3
  37. data/lib/prmd/templates/init_default.json +5 -3
  38. data/lib/prmd/templates/init_resource.json.erb +17 -4
  39. data/lib/prmd/templates/schemata/helper.erb +78 -5
  40. data/lib/prmd/templates/schemata/link.md.erb +9 -3
  41. data/lib/prmd/templates/schemata/link_curl_example.md.erb +8 -5
  42. data/lib/prmd/templates/schemata.md.erb +13 -6
  43. data/lib/prmd/url_generator.rb +2 -2
  44. data/lib/prmd/version.rb +1 -1
  45. data/lib/prmd.rb +8 -7
  46. data/schemas/interagent-hyper-schema.json +4 -1
  47. data/test/commands/render_test.rb +110 -1
  48. data/test/commands/verify_test.rb +2 -2
  49. data/test/core/reference_localizer_test.rb +65 -0
  50. data/test/helpers.rb +117 -3
  51. data/test/link_test.rb +41 -0
  52. data/test/multi_loader/common.rb +35 -0
  53. data/test/multi_loader/json_test.rb +14 -0
  54. data/test/multi_loader/toml_test.rb +18 -0
  55. data/test/multi_loader/yajl_test.rb +18 -0
  56. data/test/multi_loader/yaml_test.rb +14 -0
  57. data/test/rake_tasks/combine_test.rb +38 -0
  58. data/test/rake_tasks/doc_test.rb +31 -0
  59. data/test/rake_tasks/verify_test.rb +23 -0
  60. data/test/schemata/data/test.json +6 -0
  61. data/test/schemata/data/test.toml +4 -0
  62. data/test/schemata/data/test.yaml +3 -0
  63. data/test/schemata/input/rake-meta.json +9 -0
  64. data/test/schemata/input/rake_combine/post.json +100 -0
  65. data/test/schemata/input/rake_combine/user.json +100 -0
  66. data/test/schemata/input/rake_doc.json +223 -0
  67. data/test/schemata/input/rake_verify.json +223 -0
  68. data/test/schemata/input/user.json +10 -1
  69. metadata +47 -3
  70. data/Gemfile.lock +0 -23
@@ -10,6 +10,9 @@
10
10
  "definitions": {
11
11
  "identity": {
12
12
  "anyOf": [
13
+ {
14
+ "$ref": "#/definitions/ref"
15
+ },
13
16
  {
14
17
  "additionalProperties": false,
15
18
  "properties": {
@@ -104,7 +107,7 @@
104
107
  "resourceLink": {
105
108
  "properties": {
106
109
  "href": {
107
- "pattern": "^(/([a-z][a-z\\-]*[a-z]|\\{\\(.*\\)\\}))+$"
110
+ "pattern": "^(/([a-z0-9][a-z0-9_\\-]*[a-z0-9]|\\{\\(.*\\)\\}))+$"
108
111
  },
109
112
  "schema": {
110
113
  "anyOf": [
@@ -20,11 +20,27 @@ class InteragentRenderTest < Minitest::Test
20
20
  }
21
21
  }
22
22
  })
23
-
24
23
  markdown = render
25
24
  assert_match /version.*v10\.9\.rc1/, markdown
26
25
  end
27
26
 
27
+
28
+ def test_render_for_schema_with_property_defined_with_oneOf
29
+ markdown = render
30
+
31
+ assert_match /\*\*options\/\[OPTION1\]\.type\*\*/, markdown
32
+ assert_match /\*\*options\/\[OPTION2\]\.type\*\*/, markdown
33
+ end
34
+
35
+
36
+
37
+ def test_render_for_example_as_an_array
38
+ # matches -d '[{...}]' taking into account line breaks and spacing
39
+ expression = /-d '\[[\s\n]+\{[\n\s]+\"name\": \"EXAMPLE\",[\n\s]+\"value\": \"example\"[\s\n]+\}[\n\s]+\]/
40
+ markdown = render
41
+ assert_match expression, markdown
42
+ end
43
+
28
44
  private
29
45
 
30
46
  def data
@@ -62,6 +78,96 @@ class InteragentRenderTest < Minitest::Test
62
78
  ],
63
79
  'properties' => {
64
80
  }
81
+ },
82
+ 'config-var' => {
83
+ 'description' => 'A configuration variable for an app.',
84
+ 'title' => 'Config-var',
85
+ 'type' => 'object',
86
+ 'definitions' => {
87
+ 'name' => {
88
+ 'description' => 'The config-var\'s name.',
89
+ 'type' => 'string',
90
+ 'example' => 'EXAMPLE'
91
+ },
92
+ 'value' => {
93
+ 'description' => 'The config-var\'s value.',
94
+ 'type' => 'string',
95
+ 'example' => 'example'
96
+ },
97
+ 'option-type1' => {
98
+ 'type' => 'string',
99
+ 'example' => 'OPTION1',
100
+ 'enum' => 'OPTION1'
101
+ },
102
+ 'option-type2' => {
103
+ 'type' => 'string',
104
+ 'example' => 'OPTION2',
105
+ 'enum' => 'OPTION2'
106
+ },
107
+ 'option1' => {
108
+ 'properties' => {
109
+ 'type' => {
110
+ '$ref' => '#/definitions/config-var/definitions/option-type1'
111
+ }
112
+ }
113
+ },
114
+ 'option2' => {
115
+ 'properties' => {
116
+ 'type' => {
117
+ '$ref' => '#/definitions/config-var/definitions/option-type2'
118
+ }
119
+ }
120
+ },
121
+ 'options' => {
122
+ 'items' => {
123
+ 'example'=> 'CHOICE1',
124
+ 'oneOf' => [
125
+ {
126
+ '$ref' => '#/definitions/config-var/definitions/option1'
127
+ },
128
+ {
129
+ '$ref' => '#/definitions/config-var/definitions/option2'
130
+ }
131
+ ]
132
+ }
133
+ }
134
+ },
135
+ 'links' => [
136
+ {
137
+ 'description' => 'Create many config-vars.',
138
+ 'href' => '/config-vars',
139
+ 'method' => 'PATCH',
140
+ 'rel' => 'instances',
141
+ 'title' => 'Create Config-var',
142
+ 'schema' => {
143
+ 'type' => [
144
+ 'array'
145
+ ],
146
+ 'items' => {
147
+ 'name' => {
148
+ '$ref' => '#/definitions/config-var/definitions/name'
149
+ },
150
+ 'value' => {
151
+ '$ref' => '#/definitions/config-var/definitions/value'
152
+ },
153
+ 'example' => [
154
+ { 'name' => 'EXAMPLE', 'value' => 'example' }
155
+ ]
156
+ }
157
+ }
158
+ }
159
+ ],
160
+ 'properties' => {
161
+ 'name' => {
162
+ '$ref' => '#/definitions/config-var/definitions/name'
163
+ },
164
+ 'value' => {
165
+ '$ref' => '#/definitions/config-var/definitions/value'
166
+ },
167
+ 'options' => {
168
+ '$ref' => '#/definitions/config-var/definitions/options'
169
+ }
170
+ }
65
171
  }
66
172
  },
67
173
  'links' => [
@@ -73,6 +179,9 @@ class InteragentRenderTest < Minitest::Test
73
179
  'properties' => {
74
180
  'app' => {
75
181
  '$ref' => '#/definitions/app'
182
+ },
183
+ 'config-var' => {
184
+ '$ref' => '#/definitions/config-var'
76
185
  }
77
186
  },
78
187
  'type' => 'object'
@@ -107,12 +107,12 @@ class InteragentHyperSchemaVerifyTest < Minitest::Test
107
107
 
108
108
  def test_resource_link_href_format
109
109
  pointer('#/definitions/app/links/0').merge!({
110
- 'href' => '/my_apps'
110
+ 'href' => '/my~apps'
111
111
  })
112
112
  errors = verify
113
113
  assert_equal 1, errors.count
114
114
  assert_match %r{^#/definitions/app/links/0/href: }, errors[0]
115
- assert_match /\/my_apps does not match /, errors[0]
115
+ assert_match /\/my~apps does not match /, errors[0]
116
116
  end
117
117
 
118
118
  def test_resource_link_required
@@ -0,0 +1,65 @@
1
+ require File.expand_path('../helpers', File.dirname(__FILE__))
2
+
3
+ module Prmd
4
+ class ReferenceLocalizerTest < Minitest::Test
5
+ def base_object
6
+ {
7
+ "type" => ["object"],
8
+ "properties" => {
9
+ "name" => {
10
+ "type" => ["nil", "string"],
11
+ "example" => "john",
12
+ },
13
+ "age" => {
14
+ "type" => ["nil", "number"],
15
+ "example" => 37,
16
+ },
17
+ },
18
+ }
19
+ end
20
+
21
+ def test_no_references
22
+ object = base_object
23
+ assert_equal object, ReferenceLocalizer.localize(object)
24
+ end
25
+
26
+ def test_simple_ref
27
+ object = base_object.merge(
28
+ "properties" => base_object["properties"].merge(
29
+ "name" => { "$ref" => "#/attributes/definitions/name" },
30
+ ),
31
+ )
32
+
33
+ new_object = ReferenceLocalizer.localize(object)
34
+ assert_equal "#/definitions/attributes/definitions/name",
35
+ new_object["properties"]["name"]["$ref"]
36
+ end
37
+
38
+ def test_simple_href
39
+ object = base_object.merge("href" => "%23%2Fschemata%2Fhello%2Fworld")
40
+ new_object = ReferenceLocalizer.localize(object)
41
+ assert_equal "%23%2Fdefinitions%2Fhello%2Fworld", new_object["href"]
42
+
43
+ object = base_object.merge("href" => "%23%2Fhello%2Fworld")
44
+ new_object = ReferenceLocalizer.localize(object)
45
+ assert_equal "%2Fhello%2Fworld", new_object["href"]
46
+ end
47
+
48
+ def test_aliases
49
+ object = base_object.merge(
50
+ "properties" => base_object["properties"].merge(
51
+ "name" => { "$ref" => "#/attributes/definitions/name" },
52
+ ),
53
+ )
54
+ object["properties"]["translated_name"] = object["properties"]["name"]
55
+
56
+ new_object = ReferenceLocalizer.localize(object)
57
+
58
+ assert_equal "#/definitions/attributes/definitions/name",
59
+ new_object["properties"]["name"]["$ref"]
60
+
61
+ assert_equal "#/definitions/attributes/definitions/name",
62
+ new_object["properties"]["translated_name"]["$ref"]
63
+ end
64
+ end
65
+ end
data/test/helpers.rb CHANGED
@@ -55,12 +55,126 @@ module CliBaseTestHelpers
55
55
  end
56
56
  end
57
57
 
58
+ module PrmdTestHelpers
59
+ module Paths
60
+ def self.schemas(*args)
61
+ File.join(File.expand_path('schemata', File.dirname(__FILE__)), *args)
62
+ end
63
+
64
+ def self.input_schemas(*args)
65
+ schemas('input', *args)
66
+ end
67
+
68
+ def self.output_schemas(*args)
69
+ schemas('output', *args)
70
+ end
71
+ end
72
+ end
73
+
74
+ def schemas_path(*args)
75
+ PrmdTestHelpers::Paths.schemas(*args)
76
+ end
77
+
58
78
  def input_schemas_path(*args)
59
- @data_path ||= File.expand_path(File.join(*args),
60
- File.join(File.dirname(__FILE__),
61
- 'schemata/input'))
79
+ PrmdTestHelpers::Paths.input_schemas(*args)
80
+ end
81
+
82
+ def output_schemas_path(*args)
83
+ PrmdTestHelpers::Paths.output_schemas(*args)
62
84
  end
63
85
 
64
86
  def user_input_schema
65
87
  @user_input_schema ||= Prmd.combine(input_schemas_path('user.json'))
66
88
  end
89
+
90
+ module PrmdLinkTestHelpers
91
+ def link_parent_required
92
+ {
93
+ "description"=>"Create User",
94
+ "href"=>"/users",
95
+ "method"=>"POST",
96
+ "rel"=>"create",
97
+ "schema"=> {
98
+ "properties"=>{
99
+ "user"=>{
100
+ "type"=>["object"], "properties"=>{"email"=>"string", "name"=>"string"}}
101
+ },
102
+ "type"=>["object"],
103
+ "required"=>["user"]
104
+ },
105
+ "title"=>"Create"
106
+ }
107
+ end
108
+
109
+ def link_no_required
110
+ {
111
+ "description"=>"Create User",
112
+ "href"=>"/users",
113
+ "method"=>"POST",
114
+ "rel"=>"create",
115
+ "schema"=> {
116
+ "properties"=>{
117
+ "user"=>{
118
+ "type"=>["object"], "properties"=>{"email"=>"string", "name"=>"string"}}
119
+ },
120
+ "type"=>["object"]
121
+ },
122
+ "title"=>"Create"
123
+ }
124
+ end
125
+
126
+ def link_child_required
127
+ {
128
+ "description"=>"Create user",
129
+ "href"=>"/users",
130
+ "method"=>"POST",
131
+ "rel"=>"create",
132
+ "schema"=> {
133
+ "properties"=>{
134
+ "user"=>{
135
+ "type"=>["object"],
136
+ "properties"=>{
137
+ "email"=>"string",
138
+ "name"=>"string"
139
+ },
140
+ "required" => ["email"]
141
+ }
142
+ },
143
+ "type"=>["object"]
144
+ },
145
+ "title"=>"Create"
146
+ }
147
+ end
148
+
149
+ def link_multiple_nested_required
150
+ {
151
+ "description"=>"Create user",
152
+ "href"=>"/users",
153
+ "method"=>"POST",
154
+ "rel"=>"create",
155
+ "schema"=> {
156
+ "properties"=>{
157
+ "user"=>{
158
+ "type"=>["object"],
159
+ "properties"=>{
160
+ "email"=>"string",
161
+ "name"=>"string"
162
+ },
163
+ "required" => ["email"]
164
+ },
165
+ "address" => {
166
+ "type"=>["object"],
167
+ "properties"=>{
168
+ "street"=>"string",
169
+ "zip"=>"string"
170
+ }
171
+ }
172
+ },
173
+ "type"=>["object"],
174
+ "required" => ["address"]
175
+ },
176
+ "title"=>"Create"
177
+ }
178
+
179
+ end
180
+ end
data/test/link_test.rb ADDED
@@ -0,0 +1,41 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '.', 'helpers'))
2
+ module Prmd
3
+ class LinkTest < MiniTest::Test
4
+ include PrmdLinkTestHelpers
5
+
6
+ [
7
+ {
8
+ title: "no_required",
9
+ required: {},
10
+ optional: {"user:email" => "string", "user:name" => "string"}
11
+ },
12
+ {
13
+ title: "parent_required",
14
+ optional: {},
15
+ required: {"user:email" => "string", "user:name" => "string"}
16
+ },
17
+ {
18
+ title: "child_required",
19
+ optional: {"user:name" => "string"},
20
+ required: {"user:email" => "string"}
21
+ },
22
+ {
23
+ title: "multiple_nested_required" ,
24
+ optional: {"user:name" => "string"},
25
+ required: {"user:email" => "string",
26
+ "address:street" => "string",
27
+ "address:zip" => "string"}
28
+ }
29
+ ].each do |test_hash|
30
+
31
+ define_method "test_#{test_hash[:title]}" do
32
+ subject = Prmd::Link.new( send("link_#{test_hash[:title]}"))
33
+ required, optional = subject.required_and_optional_parameters
34
+
35
+ assert_equal required, test_hash[:required]
36
+ assert_equal optional, test_hash[:optional]
37
+ end
38
+ end
39
+
40
+ end
41
+ end
@@ -0,0 +1,35 @@
1
+ require File.expand_path('../helpers', File.dirname(__FILE__))
2
+
3
+ module PrmdLoaderTests
4
+ # @abstrac
5
+ def testing_filename
6
+ #
7
+ end
8
+
9
+ # @abstract
10
+ def loader_module
11
+ #
12
+ end
13
+
14
+ def assert_test_data(data)
15
+ assert_kind_of Hash, data
16
+ assert_equal 'yes', data['test']
17
+ assert_kind_of Hash, data['object']
18
+ assert_equal 'Object', data['object']['is_a']
19
+ end
20
+
21
+ def test_load_data
22
+ data = File.read(testing_filename)
23
+ assert_test_data loader_module.load_data(data)
24
+ end
25
+
26
+ def test_load_stream
27
+ File.open(testing_filename, 'r') do |f|
28
+ assert_test_data loader_module.load_stream(f)
29
+ end
30
+ end
31
+
32
+ def test_load_file
33
+ assert_test_data loader_module.load_file(testing_filename)
34
+ end
35
+ end
@@ -0,0 +1,14 @@
1
+ require File.expand_path('common', File.dirname(__FILE__))
2
+ require 'prmd/multi_loader/json'
3
+
4
+ class PrmdMultiLoaderJsonTest < Minitest::Test
5
+ include PrmdLoaderTests
6
+
7
+ def loader_module
8
+ Prmd::MultiLoader::Json
9
+ end
10
+
11
+ def testing_filename
12
+ schemas_path('data/test.json')
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ require File.expand_path('common', File.dirname(__FILE__))
2
+ begin
3
+ require 'prmd/multi_loader/toml'
4
+ rescue LoadError
5
+ #
6
+ end
7
+
8
+ class PrmdMultiLoaderTomlTest < Minitest::Test
9
+ include PrmdLoaderTests
10
+
11
+ def loader_module
12
+ Prmd::MultiLoader::Toml
13
+ end
14
+
15
+ def testing_filename
16
+ schemas_path('data/test.toml')
17
+ end
18
+ end if defined?(TOML)
@@ -0,0 +1,18 @@
1
+ require File.expand_path('common', File.dirname(__FILE__))
2
+ begin
3
+ require 'prmd/multi_loader/yajl'
4
+ rescue LoadError
5
+ #
6
+ end
7
+
8
+ class PrmdMultiLoaderYajlTest < Minitest::Test
9
+ include PrmdLoaderTests
10
+
11
+ def loader_module
12
+ Prmd::MultiLoader::Yajl
13
+ end
14
+
15
+ def testing_filename
16
+ schemas_path('data/test.json')
17
+ end
18
+ end if defined?(Yajl)
@@ -0,0 +1,14 @@
1
+ require File.expand_path('common', File.dirname(__FILE__))
2
+ require 'prmd/multi_loader/yaml'
3
+
4
+ class PrmdMultiLoaderYamlTest < Minitest::Test
5
+ include PrmdLoaderTests
6
+
7
+ def loader_module
8
+ Prmd::MultiLoader::Yaml
9
+ end
10
+
11
+ def testing_filename
12
+ schemas_path('data/test.yaml')
13
+ end
14
+ end
@@ -0,0 +1,38 @@
1
+ require File.expand_path('../helpers', File.dirname(__FILE__))
2
+ require 'prmd/rake_tasks/combine'
3
+ require 'rake'
4
+
5
+ # due to the nature of these Rake Tests, this should not be executed in a
6
+ # read-only filesystem or directory.
7
+ class PrmdRakeTaskCombineTest < Minitest::Test
8
+ def test_define_wo_options
9
+ paths = [input_schemas_path('rake_combine')]
10
+ #output_file = output_schemas_path('rake_combine_with_options.json')
11
+ output_file = nil
12
+ File.delete(output_file) if File.exist?(output_file) if output_file
13
+ Prmd::RakeTasks::Combine.new do |t|
14
+ t.name = :combine_wo_options
15
+ t.options[:meta] = input_schemas_path('rake-meta.json')
16
+ t.paths.concat(paths)
17
+ t.output_file = output_file
18
+ end
19
+ Rake::Task['combine_wo_options'].invoke
20
+ assert File.exist?(output_file) if output_file
21
+ end
22
+
23
+ def test_define_with_options
24
+ paths = [input_schemas_path('rake_combine')]
25
+ #output_file = output_schemas_path('rake_combine_with_options.json')
26
+ output_file = nil
27
+ options = {
28
+ meta: input_schemas_path('rake-meta.json')
29
+ }
30
+ File.delete(output_file) if File.exist?(output_file) if output_file
31
+ Prmd::RakeTasks::Combine.new(name: :combine_with_options,
32
+ paths: paths,
33
+ output_file: output_file,
34
+ options: options)
35
+ Rake::Task['combine_with_options'].invoke
36
+ assert File.exist?(output_file) if output_file
37
+ end
38
+ end
@@ -0,0 +1,31 @@
1
+ require File.expand_path('../helpers', File.dirname(__FILE__))
2
+ require 'prmd/rake_tasks/doc'
3
+ require 'rake'
4
+
5
+ # due to the nature of these Rake Tests, this should not be executed in a
6
+ # read-only filesystem or directory.
7
+ class PrmdRakeTaskDocTest < Minitest::Test
8
+ def test_define_wo_options
9
+ input_file = input_schemas_path('rake_doc.json')
10
+ #output_file = output_schemas_path('rake_doc_with_options.md')
11
+ output_file = nil
12
+ File.delete(output_file) if File.exist?(output_file) if output_file
13
+ Prmd::RakeTasks::Doc.new do |t|
14
+ t.name = :doc_wo_options
15
+ t.files = { input_file => output_file }
16
+ end
17
+ Rake::Task['doc_wo_options'].invoke
18
+ assert File.exist?(output_file) if output_file
19
+ end
20
+
21
+ def test_define_with_options
22
+ input_file = input_schemas_path('rake_doc.json')
23
+ #output_file = output_schemas_path('rake_doc_with_options.md')
24
+ output_file = nil
25
+ File.delete(output_file) if File.exist?(output_file) if output_file
26
+ Prmd::RakeTasks::Doc.new(name: :doc_with_options,
27
+ files: { input_file => output_file })
28
+ Rake::Task['doc_with_options'].invoke
29
+ assert File.exist?(output_file) if output_file
30
+ end
31
+ end
@@ -0,0 +1,23 @@
1
+ require File.expand_path('../helpers', File.dirname(__FILE__))
2
+ require 'prmd/rake_tasks/verify'
3
+ require 'rake'
4
+
5
+ # due to the nature of these Rake Tests, this should not be executed in a
6
+ # read-only filesystem or directory.
7
+ class PrmdRakeTaskVerifyTest < Minitest::Test
8
+ def test_define_wo_options
9
+ input_file = input_schemas_path('rake_verify.json')
10
+ Prmd::RakeTasks::Verify.new do |t|
11
+ t.name = :verify_wo_options
12
+ t.files = [input_file]
13
+ end
14
+ Rake::Task['verify_wo_options'].invoke
15
+ end
16
+
17
+ def test_define_with_options
18
+ input_file = input_schemas_path('rake_verify.json')
19
+ Prmd::RakeTasks::Verify.new(name: :verify_with_options,
20
+ files: [input_file])
21
+ Rake::Task['verify_with_options'].invoke
22
+ end
23
+ end
@@ -0,0 +1,6 @@
1
+ {
2
+ "test": "yes",
3
+ "object": {
4
+ "is_a": "Object"
5
+ }
6
+ }
@@ -0,0 +1,4 @@
1
+ test = "yes"
2
+
3
+ [object]
4
+ is_a = "Object"
@@ -0,0 +1,3 @@
1
+ test: "yes"
2
+ object:
3
+ is_a: "Object"
@@ -0,0 +1,9 @@
1
+ {
2
+ "id": "rake_task_meta",
3
+ "title": "Rake Task Test",
4
+ "links": [{
5
+ "href": "https://prmd.rake_task_test.io",
6
+ "rel": "self"
7
+ }],
8
+ "description": "Testing schema for Prmd RakeTasks"
9
+ }