Skip to content

Commit

Permalink
add File#exists?
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed May 12, 2015
1 parent f826562 commit d2b92c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/serverspec/type/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ def immutable?
@runner.check_file_is_immutable(@name)
end

def exists?
@runner.check_file_exists(@name)
end

def md5sum
@runner.get_file_md5sum(@name).stdout.strip
end
Expand Down
4 changes: 4 additions & 0 deletions spec/type/base/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
it { should be_symlink }
end

describe file('/bin/sh') do
it { should exist }
end

describe file('/etc/ssh/sshd_config') do
it { should contain 'This is the sshd server system-wide configuration file' }
end
Expand Down

1 comment on commit d2b92c9

@joelhandwell
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.