Skip to content

Instantly share code, notes, and snippets.

@zsprackett
Created January 28, 2012 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zsprackett/1695402 to your computer and use it in GitHub Desktop.
Save zsprackett/1695402 to your computer and use it in GitHub Desktop.
rspec-puppet
# this works
it { should \
contain_file("/etc/httpd/vhosts.d/#{t}.sjc.sugarcrm.pvt.conf")\
.with_content(/ServerName #{t}.sjc.sugarcrm.pvt/) }
# this ignores the argument and tests for an empty file
it { should \
contain_file("/etc/httpd/vhosts.d/#{t}.sjc.sugarcrm.pvt.conf")\
.without_content(/VirtualHost \*:443/) }
# this doesn't work because the should_not is asserted on contain_file
it { should_not \
contain_file("/etc/httpd/vhosts.d/#{t}.sjc.sugarcrm.pvt.conf")\
.without_content(/VirtualHost \*:443/) }
# what's the proper way to test for this?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment