Implement `file_match' condition keyword
This commit is contained in:
18
lib/producer/core/tests/file_match.rb
Normal file
18
lib/producer/core/tests/file_match.rb
Normal 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
|
Reference in New Issue
Block a user