Skip to content

Commit 92adb2a

Browse files
committed
add more invalid schema samples
1 parent cce8088 commit 92adb2a

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
usage_colors: true
2+
partials_extension: [1, 2]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usage: true

support/runfile/schema.runfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ action :all do
99
check_invalid
1010
end
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+
1229
help 'Test the bashly schema against a single example'
1330
usage 'example EXAMPLE'
1431
action(: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

0 commit comments

Comments
 (0)