]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
Add raise_error matcher to the test options
authorAndjelko Horvat <andjelko.horvat.comel@gmail.com>
Thu, 8 Dec 2016 22:50:07 +0000 (23:50 +0100)
committerAndjelko Horvat <andjelko.horvat.comel@gmail.com>
Thu, 8 Dec 2016 22:50:07 +0000 (23:50 +0100)
spec/unit/puppet/provider/iptables_spec.rb

index f9316d96abec22b834fcb2de1cc72ec90a5ec7da..eb85e88769a3e6e1d574d920c8f2ca327415d407 100644 (file)
@@ -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