我们说我有事实档案:
code_in_git(a)
code_in_git(b)
code_in_git(c)
build_on_disk(a)
build_on_disk(c)
我想断言规则" 如果是code_in_git($ branch)而不是build_on_disk($ branch),请创建fact needs_build($ branch)"。我怎么能这样做?
答案 0 :(得分:5)
好的,似乎我可以用notany
声明它们:
no_build_on_disk
foreach
deploy.code_in_git($branch)
notany
deploy.build_on_disk($branch)
assert
deploy.needs_build($branch)