<commit_before>require 'spec_helper'

describe 'sasl' do

  context 'on unsupported distributions' do
    let(:facts) do
      {
        :osfamily => 'Unsupported'
      }
    end

    it do
      expect { should compile }.to raise_error(/not supported on an Unsupported/)
    end
  end

  context 'on RedHat' do
    let(:facts) do
      {
        :osfamily => 'RedHat'
      }
    end

    [6, 7].each do |version|
      context "version #{version}", :compile do
        let(:facts) do
          super().merge(
            {
              :operatingsystemmajrelease => version
            }
          )
        end

        it do
          should contain_anchor('sasl::begin')
          should contain_anchor('sasl::end')
          should contain_class('sasl')
          should contain_class('sasl::config')
          should contain_class('sasl::install')
          should contain_class('sasl::params')
          should contain_file('/etc/sasl2')
          should contain_package('cyrus-sasl-lib')
        end
      end
    end
  end

  context 'on Ubuntu' do
    let(:facts) do
      {
        :osfamily        => 'Debian',
        :operatingsystem => 'Ubuntu',
        :lsbdistid       => 'Ubuntu'
      }
    end

    ['precise', 'trusty'].each do |codename|
      context "#{codename}", :compile do
        let(:facts) do
          super().merge(
            {
              :lsbdistcodename => codename
            }
          )
        end

        it do
          should contain_anchor('sasl::begin')
          should contain_anchor('sasl::end')
          should contain_class('sasl')
          should contain_class('sasl::config')
          should contain_class('sasl::install')
          should contain_class('sasl::params')
          should contain_file('/usr/lib/sasl2')
          should contain_package('libsasl2-2')
        end
      end
    end
  end

  context 'on Debian' do
    let(:facts) do
      {
        :osfamily        => 'Debian',
        :operatingsystem => 'Debian',
        :lsbdistid       => 'Debian'
      }
    end

    ['squeeze', 'wheezy'].each do |codename|
      context "#{codename}", :compile do
        let(:facts) do
          super().merge(
            {
              :lsbdistcodename => codename
            }
          )
        end

        it do
          should contain_anchor('sasl::begin')
          should contain_anchor('sasl::end')
          should contain_class('sasl')
          should contain_class('sasl::config')
          should contain_class('sasl::install')
          should contain_class('sasl::params')
          should contain_file('/usr/lib/sasl2')
          should contain_package('libsasl2-2')
        end
      end
    end
  end
end<commit_msg>Use single rather than multiple expectations<commit_after>require 'spec_helper'

describe 'sasl' do

  context 'on unsupported distributions' do
    let(:facts) do
      {
        :osfamily => 'Unsupported'
      }
    end

    it { expect { should compile }.to raise_error(/not supported on an Unsupported/) }
  end

  context 'on RedHat' do
    let(:facts) do
      {
        :osfamily => 'RedHat'
      }
    end

    [6, 7].each do |version|
      context "version #{version}", :compile do
        let(:facts) do
          super().merge(
            {
              :operatingsystemmajrelease => version
            }
          )
        end

        it { should contain_anchor('sasl::begin') }
        it { should contain_anchor('sasl::end') }
        it { should contain_class('sasl') }
        it { should contain_class('sasl::config') }
        it { should contain_class('sasl::install') }
        it { should contain_class('sasl::params') }
        it { should contain_file('/etc/sasl2') }
        it { should contain_package('cyrus-sasl-lib') }
      end
    end
  end

  context 'on Ubuntu' do
    let(:facts) do
      {
        :osfamily        => 'Debian',
        :operatingsystem => 'Ubuntu',
        :lsbdistid       => 'Ubuntu'
      }
    end

    ['precise', 'trusty'].each do |codename|
      context "#{codename}", :compile do
        let(:facts) do
          super().merge(
            {
              :lsbdistcodename => codename
            }
          )
        end

        it { should contain_anchor('sasl::begin') }
        it { should contain_anchor('sasl::end') }
        it { should contain_class('sasl') }
        it { should contain_class('sasl::config') }
        it { should contain_class('sasl::install') }
        it { should contain_class('sasl::params') }
        it { should contain_file('/usr/lib/sasl2') }
        it { should contain_package('libsasl2-2') }
      end
    end
  end

  context 'on Debian' do
    let(:facts) do
      {
        :osfamily        => 'Debian',
        :operatingsystem => 'Debian',
        :lsbdistid       => 'Debian'
      }
    end

    ['squeeze', 'wheezy'].each do |codename|
      context "#{codename}", :compile do
        let(:facts) do
          super().merge(
            {
              :lsbdistcodename => codename
            }
          )
        end

        it { should contain_anchor('sasl::begin') }
        it { should contain_anchor('sasl::end') }
        it { should contain_class('sasl') }
        it { should contain_class('sasl::config') }
        it { should contain_class('sasl::install') }
        it { should contain_class('sasl::params') }
        it { should contain_file('/usr/lib/sasl2') }
        it { should contain_package('libsasl2-2') }
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.12217359591539023, 'fraction_numerical': 0.0032822757111597373, 'mean_word_length': 1.7828513444951801, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, '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': '4521577', 'n_tokens_mistral': 1727, 'n_tokens_neox': 1652, 'n_words': 363}