<commit_before>require 'spec_helper'

describe 'duplicity' do
  let(:title) { 'duplicity' }

  describe 'by default' do
    let(:params) { {} }

    it { should contain_package('duplicity').with(
        'ensure' => 'installed',
        'name'   => 'duplicity'
      )
    }
    it { should contain_archive('duply-1.7.3').with(
        'ensure'     => 'present',
        'root_dir'   => 'duply_1.7.3',
        'target'     => '/opt',
        'src_target' => '/var/cache/puppet/archives'
      )
    }
    it { should contain_file('/usr/local/bin/duply') }
    it {
      should contain_file('/etc/duply').with(
        'ensure' => 'directory',
        'owner'  => 'root',
        'group'  => 'root',
        'mode'   => '0644',
      )
    }
    it {
      should contain_file('/etc/duply-keys').with(
        'ensure' => 'directory',
        'owner'  => 'root',
        'group'  => 'root',
        'mode'   => '0644',
      )
    }
    it {
      should contain_file('/etc/duply-keys/public').with(
        'ensure' => 'directory',
        'owner'  => 'root',
        'group'  => 'root',
        'mode'   => '0644',
      )
    }
    it {
      should contain_file('/etc/duply-keys/private').with(
        'ensure' => 'directory',
        'owner'  => 'root',
        'group'  => 'root',
        'mode'   => '0600',
      )
    }
    it { should contain_logrotate__rule('duplicity') }
  end

  describe 'with duplicity_package_ensure => 1.2.3' do
    let(:params) { {:duplicity_package_ensure => '1.2.3'} }

    it { should contain_package('duplicity').with_ensure('1.2.3') }
  end

  describe 'with duplicity_package_ensure => 0.6.18-3~bpo60+1' do
    let(:params) { {:duplicity_package_ensure => '0.6.18-3~bpo60+1'} }

    it { should contain_package('duplicity').with_ensure('0.6.18-3~bpo60+1') }
  end

  describe 'with empty duplicity_package_ensure' do<commit_msg>Fix Ruby 1.8 issues<commit_after>require 'spec_helper'

describe 'duplicity' do
  let(:title) { 'duplicity' }

  describe 'by default' do
    let(:params) { {} }

    it { should contain_package('duplicity').with(
        'ensure' => 'installed',
        'name'   => 'duplicity'
      )
    }
    it { should contain_archive('duply-1.7.3').with(
        'ensure'     => 'present',
        'root_dir'   => 'duply_1.7.3',
        'target'     => '/opt',
        'src_target' => '/var/cache/puppet/archives'
      )
    }
    it { should contain_file('/usr/local/bin/duply') }
    it {
      should contain_file('/etc/duply').with(
        'ensure' => 'directory',
        'owner'  => 'root',
        'group'  => 'root',
        'mode'   => '0644'
      )
    }
    it {
      should contain_file('/etc/duply-keys').with(
        'ensure' => 'directory',
        'owner'  => 'root',
        'group'  => 'root',
        'mode'   => '0644'
      )
    }
    it {
      should contain_file('/etc/duply-keys/public').with(
        'ensure' => 'directory',
        'owner'  => 'root',
        'group'  => 'root',
        'mode'   => '0644'
      )
    }
    it {
      should contain_file('/etc/duply-keys/private').with(
        'ensure' => 'directory',
        'owner'  => 'root',
        'group'  => 'root',
        'mode'   => '0600'
      )
    }
    it { should contain_logrotate__rule('duplicity') }
  end

  describe 'with duplicity_package_ensure => 1.2.3' do
    let(:params) { {:duplicity_package_ensure => '1.2.3'} }

    it { should contain_package('duplicity').with_ensure('1.2.3') }
  end

  describe 'with duplicity_package_ensure => 0.6.18-3~bpo60+1' do
    let(:params) { {:duplicity_package_ensure => '0.6.18-3~bpo60+1'} }

    it { should contain_package('duplicity').with_ensure('0.6.18-3~bpo60+1') }
  end

  describe 'with empty duplicity_package_ensure' do
{'fraction_non_alphanumeric': 0.18359166221272047, 'fraction_numerical': 0.029930518439337254, 'mean_word_length': 2.1909633418584824, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 55, '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': '4089231', 'n_tokens_mistral': 1369, 'n_tokens_neox': 1313, 'n_words': 222}