<commit_before>require 'spec_helper'

describe 'aptly' do
  let(:facts) {{
    :lsbdistid => 'Debian',
    :osfamily  => 'Debian',
  }}

  context 'param defaults' do
    let(:params) {{ }}

    it { should contain_apt__source('aptly') }
    it { should contain_package('aptly').that_requires('Apt::Update') }
    it { should contain_file('/etc/aptly.conf').with_content("{}\n") }
  end

  describe '#package_ensure' do
    context 'present (default)' do
      let(:params) {{ }}

      it { should contain_package('aptly').with_ensure('present') }
    end

    context '1.2.3' do
      let(:params) {{
        :package_ensure => '1.2.3',
      }}

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

  describe '#key_server (with #repo default to true)' do
    context 'custom key_server' do
      let(:params) {{
        :key_server => 'somekeyserver.com',
      }}

      it "should override apt::source (somekeyserver.com)" do
        should contain_apt__source('aptly').with(
          :key_server => 'somekeyserver.com',
        )
      end
    end
  end<commit_msg>adapt test to new version<commit_after>require 'spec_helper'

describe 'aptly' do
  let(:facts) {{
    :lsbdistid => 'Debian',
    :osfamily  => 'Debian',
  }}

  context 'param defaults' do
    let(:params) {{ }}

    it { should contain_apt__source('aptly') }
    it { should contain_package('aptly').that_requires('Apt::Update') }
    it { should contain_file('/etc/aptly.conf').with_content("{}\n") }
  end

  describe '#package_ensure' do
    context 'present (default)' do
      let(:params) {{ }}

      it { should contain_package('aptly').with_ensure('present') }
    end

    context '1.2.3' do
      let(:params) {{
        :package_ensure => '1.2.3',
      }}

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

  describe '#key_server (with #repo default to true)' do
    context 'custom key_server' do
      let(:params) {{
        :key_server => 'somekeyserver.com',
      }}

      it "should override apt::source (somekeyserver.com)" do
        should contain_apt__source('aptly').with(
          :key => {
            :server => 'somekeyserver.com',
          }
        )
      end
    end
  end
{'fraction_non_alphanumeric': 0.15463458110516934, 'fraction_numerical': 0.008021390374331552, 'mean_word_length': 2.6863711001642034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '2455785', 'n_tokens_mistral': 749, 'n_tokens_neox': 719, 'n_words': 156}