Skip to content

Instantly share code, notes, and snippets.

@hemalvarambhia
Created November 24, 2014 14:20
Show Gist options
  • Save hemalvarambhia/f067c2e8b49ea4ea7f5f to your computer and use it in GitHub Desktop.
Save hemalvarambhia/f067c2e8b49ea4ea7f5f to your computer and use it in GitHub Desktop.
Factory methods that provide a fluent interface to the NginxPrivilegeMatcher
if defined?(ChefSpec)
def whitelist_requests_from(ip_addresses)
ChefSpec::Matchers::NginxPrivilegeMatcher.new(chef_run, ip_addresses, "allow")
end
def blacklist_requests_from(ip_addresses)
ChefSpec::Matchers::NginxPrivilegeMatcher.new(chef_run, ip_addresses, "deny")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment