File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
spec/fixtures/schemas_invalid Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ usage_colors : true
2+ partials_extension : [1, 2]
Original file line number Diff line number Diff line change 1+ usage : true
Original file line number Diff line number Diff line change @@ -9,6 +9,23 @@ action :all do
99 check_invalid
1010end
1111
12+ help 'Test any file against any schema'
13+ usage 'file [--anti] PATH [SCHEMA]'
14+ option '-a, --anti', 'Run anticheck instead (expect failure)'
15+ param 'PATH', 'The path to the tested YAML file'
16+ param 'SCHEMA', 'The name of the schema (bashly, settings of strings) [default: bashly]'
17+ example 'run schema file -a spec/fixtures/schemas_invalid/bashly/1.yml'
18+ example 'run schema file -a spec/fixtures/schemas_invalid/settings/2.yml settings'
19+ action(:file) do |args|
20+ schema = args['SCHEMA'] || 'bashly'
21+ if args['--anti']
22+ schema_anticheck args['PATH'], schema
23+ else
24+ schema_check args['PATH'], schema
25+ end
26+ say "\ngub`PASS`"
27+ end
28+
1229help 'Test the bashly schema against a single example'
1330usage 'example EXAMPLE'
1431action(:example) { |args| schema_check "examples/#{args['EXAMPLE']}/src/bashly.yml" }
@@ -35,6 +52,7 @@ helpers do
3552 file = example.yaml_path
3653 schema_check file
3754 end
55+ say "\ngub`Examples PASS`"
3856 end
3957
4058 def check_settings
You can’t perform that action at this time.
0 commit comments