commit 01d8a819a56fcaf14e4b7b73774a6ed4dc30635a
Author: tr <tr@immerda.ch>
Date:   Fri Oct 16 16:29:55 2020 +0200

    Styling to make tests green

diff --git a/spec/classes/masquerade_spec.rb b/spec/classes/masquerade_spec.rb
index c53d41a..501c82a 100644
--- a/spec/classes/masquerade_spec.rb
+++ b/spec/classes/masquerade_spec.rb
@@ -9,83 +9,103 @@ describe 'nftables' do
 
       context 'with masquerade' do
         let(:pre_condition) do
-          """
+          '
           nftables::rules::masquerade{
-            'masquerade_eth0':
-              oif => 'eth0';
-            'masquerade_eth1_vpn':
-              oif   => 'eth1',
-              saddr => '192.0.2.0/24';
-            'masquerade_ssh':
-              saddr => '192.0.2.0/24',
-              daddr => '198.51.100.2',
-              proto => 'tcp',
-              dport => '22';
-            'masquerade_ssh_gitlab':
-              saddr => '192.0.2.0/24',
-              daddr => '198.51.100.2',
-              dport => '22';
-            'masquerade_wireguard':
-              proto => 'udp',
-              dport => '51820';
+            \'masquerade_eth0\':
+              oif => \'eth0\';
+            \'masquerade_eth1_vpn\':
+              oif   => \'eth1\',
+              saddr => \'192.0.2.0/24\';
+            \'masquerade_ssh\':
+              saddr => \'192.0.2.0/24\',
+              daddr => \'198.51.100.2\',
+              proto => \'tcp\',
+              dport => \'22\';
+            \'masquerade_ssh_gitlab\':
+              saddr => \'192.0.2.0/24\',
+              daddr => \'198.51.100.2\',
+              dport => \'22\';
+            \'masquerade_wireguard\':
+              proto => \'udp\',
+              dport => \'51820\';
           }
-          """
+          '
         end
 
         it { is_expected.to compile }
 
-        it { is_expected.to contain_concat('nftables-ip-nat-chain-POSTROUTING').with(
-          :path           => '/etc/nftables/puppet/ip-nat-chain-POSTROUTING.nft',
-          :owner          => 'root',
-          :group          => 'root',
-          :mode           => '0640',
-          :ensure_newline => true,
-        )}
-        it { is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-header').with(
-          :target  => 'nftables-ip-nat-chain-POSTROUTING',
-          :content => /^chain POSTROUTING {$/,
-          :order   => '00',
-        )}
-        it { is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-type').with(
-          :target  => 'nftables-ip-nat-chain-POSTROUTING',
-          :content => /^  type nat hook postrouting priority 100$/,
-          :order   => '01',
-        )}
-        it { is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-policy').with(
-          :target  => 'nftables-ip-nat-chain-POSTROUTING',
-          :content => /^  policy accept$/,
-          :order   => '02',
-        )}
-        it { is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-masquerade_eth0').with(
-          :target  => 'nftables-ip-nat-chain-POSTROUTING',
-          :content => /^  oifname eth0 masquerade$/,
-          :order   => '70',
-        )}
-        it { is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-masquerade_eth1_vpn').with(
-          :target  => 'nftables-ip-nat-chain-POSTROUTING',
-          :content => /^  oifname eth1 ip saddr 192\.0\.2\.0\/24 masquerade$/,
-          :order   => '70',
-        )}
-        it { is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-masquerade_ssh').with(
-          :target  => 'nftables-ip-nat-chain-POSTROUTING',
-          :content => /^  ip saddr 192\.0\.2\.0\/24 ip daddr 198.51.100.2 tcp dport 22 masquerade$/,
-          :order   => '70',
-        )}
-        it { is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-masquerade_ssh_gitlab').with(
-          :target  => 'nftables-ip-nat-chain-POSTROUTING',
-          :content => /^  ip saddr 192\.0\.2\.0\/24 ip daddr 198.51.100.2 tcp dport 22 masquerade$/,
-          :order   => '70',
-        )}
-        it { is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-masquerade_wireguard').with(
-          :target  => 'nftables-ip-nat-chain-POSTROUTING',
-          :content => /^  udp dport 51820 masquerade$/,
-          :order   => '70',
-        )}
-        it { is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-footer').with(
-          :target  => 'nftables-ip-nat-chain-POSTROUTING',
-          :content => /^}$/,
-          :order   => '99',
-        )}
+        it {
+          is_expected.to contain_concat('nftables-ip-nat-chain-POSTROUTING').with(
+            path:           '/etc/nftables/puppet/ip-nat-chain-POSTROUTING.nft',
+            owner:          'root',
+            group:          'root',
+            mode:           '0640',
+            ensure_newline: true,
+          )
+        }
+        it {
+          is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-header').with(
+            target:  'nftables-ip-nat-chain-POSTROUTING',
+            content: %r{^chain POSTROUTING \{$},
+            order:   '00',
+          )
+        }
+        it {
+          is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-type').with(
+            target:  'nftables-ip-nat-chain-POSTROUTING',
+            content: %r{^  type nat hook postrouting priority 100$},
+            order:   '01',
+          )
+        }
+        it {
+          is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-policy').with(
+            target:  'nftables-ip-nat-chain-POSTROUTING',
+            content: %r{^  policy accept$},
+            order:   '02',
+          )
+        }
+        it {
+          is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-masquerade_eth0').with(
+            target:  'nftables-ip-nat-chain-POSTROUTING',
+            content: %r{^  oifname eth0 masquerade$},
+            order:   '70',
+          )
+        }
+        it {
+          is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-masquerade_eth1_vpn').with(
+            target:  'nftables-ip-nat-chain-POSTROUTING',
+            content: %r{^  oifname eth1 ip saddr 192\.0\.2\.0\/24 masquerade$},
+            order:   '70',
+          )
+        }
+        it {
+          is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-masquerade_ssh').with(
+            target:  'nftables-ip-nat-chain-POSTROUTING',
+            content: %r{^  ip saddr 192\.0\.2\.0\/24 ip daddr 198.51.100.2 tcp dport 22 masquerade$},
+            order:   '70',
+          )
+        }
+        it {
+          is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-masquerade_ssh_gitlab').with(
+            target:  'nftables-ip-nat-chain-POSTROUTING',
+            content: %r{^  ip saddr 192\.0\.2\.0\/24 ip daddr 198.51.100.2 tcp dport 22 masquerade$},
+            order:   '70',
+          )
+        }
+        it {
+          is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-rule-masquerade_wireguard').with(
+            target:  'nftables-ip-nat-chain-POSTROUTING',
+            content: %r{^  udp dport 51820 masquerade$},
+            order:   '70',
+          )
+        }
+        it {
+          is_expected.to contain_concat__fragment('nftables-ip-nat-chain-POSTROUTING-footer').with(
+            target:  'nftables-ip-nat-chain-POSTROUTING',
+            content: %r{^\}$},
+            order:   '99',
+          )
+        }
       end
     end
   end
