lib/serverspec/matchers/have_rule.rb in serverspec-0.4.4 vs lib/serverspec/matchers/have_rule.rb in serverspec-0.4.5
- old
+ new
@@ -1,7 +1,11 @@
RSpec::Matchers.define :have_rule do |rule|
- match do |iptables|
- iptables.has_rule?(rule, @table, @chain)
+ match do |subject|
+ if subject.class.name == 'Serverspec::Type::Iptables'
+ subject.has_rule?(rule, @table, @chain)
+ else
+ subject.has_rule?(rule)
+ end
end
chain :with_table do |table|
@table = table
end
chain :with_chain do |chain|