Unverified Commit 125d35ca authored by Kenyon Ralph's avatar Kenyon Ralph Committed by GitHub
Browse files

Merge pull request #318 from kenyon/tests-cleanup

remove unneeded tests; provide error message for raise_error
parents e430a8a9 f93a331a
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -13,20 +13,6 @@ describe 'postfix::conffile' do
        facts
      end

      context 'when passing wrong type for ensure' do
        let(:params) do
          {
            ensure: ['present'],
          }
        end

        it 'fails' do
          expect do
            is_expected.to contain_file('postfix conffile foo')
          end.to raise_error
        end
      end

      context 'when passing wrong value for ensure' do
        let(:params) do
          {
+1 −30
Original line number Diff line number Diff line
@@ -23,36 +23,7 @@ describe 'postfix::config' do
        it 'fails' do
          expect do
            is_expected.to contain_augeas("set postfix 'foo'")
          end.to raise_error
        end
      end

      context 'when passing wrong type for value' do
        let(:params) do
          {
            value: ['bar'],
          }
        end

        it 'fails' do
          expect do
            is_expected.to contain_augeas("set postfix 'foo'")
          end.to raise_error
        end
      end

      context 'when passing wrong type for ensure' do
        let(:params) do
          {
            value: 'bar',
            ensure: ['present'],
          }
        end

        it 'fails' do
          expect do
            is_expected.to contain_augeas("set postfix 'foo'")
          end.to raise_error
          end.to raise_error(Puppet::Error, %r{can not be empty if ensure = present})
        end
      end

+0 −14
Original line number Diff line number Diff line
@@ -13,20 +13,6 @@ describe 'postfix::hash' do
        facts
      end

      context 'when passing wrong type for ensure' do
        let(:params) do
          {
            ensure: ['present'],
          }
        end

        it 'fails' do
          expect do
            is_expected.to contain_file('/tmp/foo')
          end.to raise_error
        end
      end

      context 'when passing wrong value for ensure' do
        let(:params) do
          {
+0 −14
Original line number Diff line number Diff line
@@ -20,20 +20,6 @@ describe 'postfix::map' do
        facts
      end

      context 'when passing wrong type for ensure' do
        let(:params) do
          {
            ensure: ['present'],
          }
        end

        it 'fails' do
          expect do
            is_expected.to contain_file('postfix map foo')
          end.to raise_error
        end
      end

      context 'when passing wrong value for ensure' do
        let(:params) do
          {
+0 −59
Original line number Diff line number Diff line
@@ -24,50 +24,6 @@ describe 'postfix::transport' do
                    puppetversion: Puppet.version)
      end

      context 'when sending wrong type for destination' do
        let(:params) do
          {
            destination: ['bar'],
          }
        end

        it 'fails' do
          expect do
            is_expected.to contain_augeas('Postfix transport - foo')
          end.to raise_error
        end
      end

      context 'when sending wrong type for nexthop' do
        let(:params) do
          {
            destination: 'bar',
            nexthop: ['baz'],
          }
        end

        it 'fails' do
          expect do
            is_expected.to contain_augeas('Postfix transport - foo')
          end.to raise_error
        end
      end

      context 'when sending wrong type for file' do
        let(:params) do
          {
            destination: 'bar',
            file: ['baz'],
          }
        end

        it 'fails' do
          expect do
            is_expected.to contain_augeas('Postfix transport - foo')
          end.to raise_error
        end
      end

      context 'when sending wrong value for file' do
        let(:params) do
          {
@@ -83,21 +39,6 @@ describe 'postfix::transport' do
        end
      end

      context 'when sending wrong type for ensure' do
        let(:params) do
          {
            destination: 'bar',
            ensure: ['baz'],
          }
        end

        it 'fails' do
          expect do
            is_expected.to contain_augeas('Postfix transport - foo')
          end.to raise_error
        end
      end

      context 'when sending wrong value for ensure' do
        let(:params) do
          {
Loading