lib/sprinkle/verifiers/file.rb in crafterm-sprinkle-0.2.0 vs lib/sprinkle/verifiers/file.rb in crafterm-sprinkle-0.2.1
- old
+ new
@@ -6,15 +6,21 @@
#
# == Example Usage
#
# verify { has_file '/etc/apache2/apache2.conf' }
#
+ # verify { file_contains '/etc/apache2/apache2.conf', 'mod_gzip'}
+ #
module File
Sprinkle::Verify.register(Sprinkle::Verifiers::File)
# Checks to make sure <tt>path</tt> is a file on the remote server.
def has_file(path)
@commands << "test -f #{path}"
+ end
+
+ def file_contains(path, text)
+ @commands << "grep '#{text}' #{path}"
end
end
end
end
\ No newline at end of file