<commit_before>require 'spec_helper'
describe 'puppetagent', :type => :class do
  context 'with defaults for all parameters' do
    let (:facts) do {
      :kernel => 'Linux',
      :osfamily => 'Redhat',
      :operatingsystem => 'CentOS',
      :operatingsystemmajrelease => '7',
    }
    end
  end

  it { is_expected.to compile }
  it { is_expected.to compile.with_all_deps }

  it { is_expected.to contain_class('puppetagent') }
  it { is_expected.to contain_class('puppetagent::install').that_comes_before('Class[puppetagent::config]') }
  it { is_expected.to contain_class('puppetagent::config').that_comes_before('Class[puppetagent::service]') }

  context 'puppetserver::install' do
    it { is_expected.to contain_package('puppet-agent') }
  end

  context 'puppetserver::config' do
    it { is_expected.to contain_augeas('agent_certname').with({
      'context' => '/files/etc/puppetlabs/puppet/puppet.conf',
    })}
    it { is_expected.to contain_augeas('agent_server').with({
      'context' => '/files/etc/puppetlabs/puppet/puppet.conf',
    })}
    it { is_expected.to contain_augeas('agent_runinterval').with({
      'context' => '/files/etc/puppetlabs/puppet/puppet.conf',
    })}
    it { is_expected.to contain_augeas('agent_environment').with({
      'context' => '/files/etc/puppetlabs/puppet/puppet.conf',
    })}
  end

  context 'puppetserver::service' do
      it { is_expected.to contain_service('puppet').with({
        'ensure' => 'running',
        'enable' => true,
        })
      }
    end

end<commit_msg>Added service class unit test<commit_after>require 'spec_helper'
describe 'puppetagent', :type => :class do
  context 'with defaults for all parameters' do
    let (:facts) do {
      :kernel => 'Linux',
      :osfamily => 'Redhat',
      :operatingsystem => 'CentOS',
      :operatingsystemmajrelease => '7',
    }
    end
  end

  it { is_expected.to compile }
  it { is_expected.to compile.with_all_deps }

  it { is_expected.to contain_class('puppetagent') }
  it { is_expected.to contain_class('puppetagent::install').that_comes_before('Class[puppetagent::config]') }
  it { is_expected.to contain_class('puppetagent::config').that_comes_before('Class[puppetagent::service]') }
  it { is_expected.to contain_class('puppetagent::service') }


  context 'puppetserver::install' do
    it { is_expected.to contain_package('puppet-agent') }
  end

  context 'puppetserver::config' do
    it { is_expected.to contain_augeas('agent_certname').with({
      'context' => '/files/etc/puppetlabs/puppet/puppet.conf',
    })}
    it { is_expected.to contain_augeas('agent_server').with({
      'context' => '/files/etc/puppetlabs/puppet/puppet.conf',
    })}
    it { is_expected.to contain_augeas('agent_runinterval').with({
      'context' => '/files/etc/puppetlabs/puppet/puppet.conf',
    })}
    it { is_expected.to contain_augeas('agent_environment').with({
      'context' => '/files/etc/puppetlabs/puppet/puppet.conf',
    })}
  end

  context 'puppetserver::service' do
      it { is_expected.to contain_service('puppet').with({
        'ensure' => 'running',
        'enable' => true,
        })
      }
    end

end
{'fraction_non_alphanumeric': 0.15279974691553305, 'fraction_numerical': 0.0006327111673521037, 'mean_word_length': 3.691394658753709, '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': '1664406', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1093, 'n_words': 176}