Implement `file_match' condition keyword

This commit is contained in:
Thibault Jouan
2014-09-27 12:14:16 +00:00
parent 1f84b484bd
commit 2543fdeb00
6 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
module Producer
module Core
module Tests
class FileMatch < Test
def verify
!!(file_content =~ arguments[1])
end
private
def file_content
fs.file_read(arguments[0]) or ''
end
end
end
end
end