<commit_before>require 'spec_helper'

describe 'openconnect' do
  context 'supported operating systems' do
    ['Debian'].each do |osfamily|
      describe "openconnect class without any parameters on #{osfamily}" do
        let(:params) {{ }}
        let(:facts) {{
          :osfamily => osfamily,
        }}

        it { should include_class('openconnect::params') }

        it { should contain_class('openconnect::install') }
        it { should contain_class('openconnect::config') }
        it { should contain_class('openconnect::service') }
      end
    end
  end

  context 'unsupported operating system' do
    describe 'openconnect class without any parameters on CentOS/RedHat' do
      let(:facts) {{
        :osfamily        => 'RedHat',
        :operatingsystem => 'CentOS',
      }}

      it { expect { should }.to raise_error(Puppet::Error, /CentOS not supported/) }
    end
  end
end<commit_msg>Add a failing test for undef params<commit_after>require 'spec_helper'

describe 'openconnect' do
  context 'supported operating systems' do
    ['Debian'].each do |osfamily|
      describe "openconnect class without any parameters on #{osfamily}" do
        let(:params) {{ }}
        let(:facts) {{
          :osfamily => osfamily,
        }}

        it { should include_class('openconnect::params') }

        it { should contain_class('openconnect::install') }
        it { should contain_class('openconnect::config') }
        it { should contain_class('openconnect::service') }

        # FIXME
        it 'should not allow required params to be bypassed' do
          expect { should }.to raise_error(Puppet::Error, /Must pass/)
        end
      end
    end
  end

  context 'unsupported operating system' do
    describe 'openconnect class without any parameters on CentOS/RedHat' do
      let(:facts) {{
        :osfamily        => 'RedHat',
        :operatingsystem => 'CentOS',
      }}

      it { expect { should }.to raise_error(Puppet::Error, /CentOS not supported/) }
    end
  end
end
{'fraction_non_alphanumeric': 0.11237623762376238, 'fraction_numerical': 0.0, 'mean_word_length': 2.6678765880217785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '891526', 'n_tokens_mistral': 576, 'n_tokens_neox': 559, 'n_words': 165}