Skip to content

Instantly share code, notes, and snippets.

@netmarkjp
Created August 15, 2013 09:02
Show Gist options
  • Save netmarkjp/6239419 to your computer and use it in GitHub Desktop.
Save netmarkjp/6239419 to your computer and use it in GitHub Desktop.
serverspec(rspec) :if example
require 'spec_helper'
def exist?(filename)
File.exist?(filename)
end
def bigger_than?(filename,size)
File.size?(filename) >= size
end
describe file('/etc/hosts'), :if => exist?('/etc/hosts') do
it('', :if => bigger_than?('/etc/hosts',100)) { should contain '127.0.0.1' }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment