spec/support/shared_matcher_examples.rb in serverspec-0.2.6 vs spec/support/shared_matcher_examples.rb in serverspec-0.2.7
- old
+ new
@@ -642,5 +642,40 @@
it { should_not have_ipfilter_rule 'invalid-rule' }
end
end
end
+shared_examples_for 'support have_ipnat_rule matcher' do |rule|
+ describe 'have_ipnat_rule' do
+ describe 'ipnat' do
+ it { should have_ipnat_rule rule }
+ end
+
+ describe 'ipnat' do
+ it { should_not have_ipnat_rule 'invalid-rule' }
+ end
+ end
+end
+
+shared_examples_for 'support have_svcprop.with_value matcher' do |svc, property, value|
+ describe 'have_svcprop' do
+ describe svc do
+ it { should have_svcprop(property).with_value(value) }
+ end
+
+ describe 'this-is-invalid-svc' do
+ it { should_not have_svcprop(property).with_value(value) }
+ end
+ end
+end
+
+shared_examples_for 'support have_svcprops matcher' do |svc, property|
+ describe 'have_svcprop' do
+ describe svc do
+ it { should have_svcprops(property) }
+ end
+
+ describe 'this-is-invalid-svc' do
+ it { should_not have_svcprops(property) }
+ end
+ end
+end