Initial Chef repository
This commit is contained in:
20
cookbooks/nginx/libraries/matchers.rb
Normal file
20
cookbooks/nginx/libraries/matchers.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
if defined?(ChefSpec)
|
||||
# Custom ChefSpec matchers
|
||||
module ChefSpec::Matchers
|
||||
RSpec::Matchers.define :enable_nginx_site do |site|
|
||||
match do |chef_run|
|
||||
chef_run.resource_collection.all_resources.any? do |resource|
|
||||
resource.resource_name == :execute && resource.name =~ /.*nxensite.*#{site}/
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RSpec::Matchers.define :disable_nginx_site do |site|
|
||||
match do |chef_run|
|
||||
chef_run.resource_collection.all_resources.any? do |resource|
|
||||
resource.resource_name == :execute && resource.name =~ /.*nxdissite.*#{site}/
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user