From: Andjelko Horvat Date: Thu, 8 Dec 2016 22:50:07 +0000 (+0100) Subject: Add raise_error matcher to the test options X-Git-Tag: 1.10.0~5^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3f31361bbc5c72ec671c20082f9ff38c47b51b33;p=puppet-modules%2Fpuppetlabs-firewall.git Add raise_error matcher to the test options --- 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