spec/sprinkle/verify_spec.rb in sprinkle-0.1.9 vs spec/sprinkle/verify_spec.rb in sprinkle-0.2.1
- old
+ new
@@ -7,10 +7,13 @@
gem 'nonexistent'
verify 'moo' do
# Check a file exists
has_file 'my_file.txt'
+ # Check that a file contains a substring
+ file_contains 'my_file.txt', 'A sunny day on the lower east-side'
+
# Check a directory exists
has_directory 'mydir'
# Check a symlink exists
has_symlink 'mypointer'
@@ -47,9 +50,13 @@
end
describe 'with checks' do
it 'should do a "test -f" on the has_file check' do
@verification.commands.should include('test -f my_file.txt')
+ end
+
+ it 'should do a grep to see if a file contains a text string' do
+ @verification.commands.should include("grep 'A sunny day on the lower east-side' my_file.txt")
end
it 'should do a "test -d" on the has_directory check' do
@verification.commands.should include('test -d mydir')
end
\ No newline at end of file