forked from plexsystems/konstraint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacceptance.bats
31 lines (26 loc) · 1.26 KB
/
acceptance.bats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bats
@test "[DOC] Generated documentation matches example documentation" {
run ./build/konstraint doc examples --output examples/policies.md
[ "$status" -eq 0 ]
git diff --quiet -- examples/policies.md
}
@test "[DOC] Generated documentation without Rego matches example documentation" {
run ./build/konstraint doc --no-rego examples --output examples/policies-no-rego.md
[ "$status" -eq 0 ]
git diff --quiet -- examples/policies-no-rego.md
}
@test "[CREATE] Creating constraints and templates matches examples" {
run ./build/konstraint create examples
[ "$status" -eq 0 ]
git diff --quiet -- examples/
}
@test "[CREATE] Creating constraints using --output matches expected output" {
run ./build/konstraint create test --output test
[ "$status" -eq 0 ]
git diff --quiet -- test/
}
@test "[CREATE] Creating constraints using --constraint-custom-template-file, --constraint-template-custom-template-file and --output matches expected output" {
run ./build/konstraint create test --constraint-custom-template-file internal/commands/constraint_template.tpl --constraint-template-custom-template-file internal/commands/constrainttemplate_template.tpl --partial-constraints --output test/custom
[ "$status" -eq 0 ]
git diff --quiet -- test/custom
}