From 3f31361bbc5c72ec671c20082f9ff38c47b51b33 Mon Sep 17 00:00:00 2001 From: Andjelko Horvat Date: Thu, 8 Dec 2016 23:50:07 +0100 Subject: [PATCH] Add raise_error matcher to the test options --- spec/unit/puppet/provider/iptables_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/unit/puppet/provider/iptables_spec.rb b/spec/unit/puppet/provider/iptables_spec.rb index f9316d9..eb85e88 100644 --- a/spec/unit/puppet/provider/iptables_spec.rb +++ b/spec/unit/puppet/provider/iptables_spec.rb @@ -215,6 +215,13 @@ describe 'iptables provider' do ARGS_TO_HASH.each do |test_name,data| describe "for test data '#{test_name}'" do let(:resource) { provider.rule_to_hash(data[:line], data[:table], 0) } + # If this option is enabled, make sure the error was raised + if data[:raise_error] then + it "the input rules should raise an error by rules_to_hash" do + expect{ resource }.to raise_error + end + end + # If this option is enabled, make sure the parameters exactly match if data[:compare_all] then it "the parameter hash keys should be the same as returned by rules_to_hash" do -- 2.45.2