<commit_before>require 'spec_helper'

describe 'yum-fedora::default' do
  context 'yum-fedora::default uses default attributes' do
    let(:chef_run) do
      ChefSpec::Runner.new do |node|
        node.set['yum']['fedora']['managed'] = true
        node.set['yum']['fedora-debuginfo']['managed'] = true
        node.set['yum']['fedora-source']['managed'] = true
        node.set['yum']['updates']['managed'] = true
        node.set['yum']['updates-debuginfo']['managed'] = true
        node.set['yum']['updates-source']['managed'] = true
        node.set['yum']['updates-testing']['managed'] = true
        node.set['yum']['updates-testing-debuginfo']['managed'] = true
        node.set['yum']['updates-testing-source']['managed'] = true
      end.converge(described_recipe)
    end

    context 'removing stock configuration files' do
      it 'deletes /etc/yum.repos.d/fedora-updates.repo' do
        expect(chef_run).to delete_file('/etc/yum.repos.d/fedora-updates.repo')
      end

      it 'deletes /etc/yum.repos.d/fedora-updates-testing.repo' do
        expect(chef_run).to delete_file('/etc/yum.repos.d/fedora-updates-testing.repo')
      end
    end

    %w(
      fedora<commit_msg>Use chefspec 4.X format<commit_after>require 'spec_helper'

describe 'yum-fedora::default' do
  context 'yum-fedora::default uses default attributes' do
    let(:chef_run) do
      ChefSpec::ServerRunner.new do |node|
        node.set['yum']['fedora']['managed'] = true
        node.set['yum']['fedora-debuginfo']['managed'] = true
        node.set['yum']['fedora-source']['managed'] = true
        node.set['yum']['updates']['managed'] = true
        node.set['yum']['updates-debuginfo']['managed'] = true
        node.set['yum']['updates-source']['managed'] = true
        node.set['yum']['updates-testing']['managed'] = true
        node.set['yum']['updates-testing-debuginfo']['managed'] = true
        node.set['yum']['updates-testing-source']['managed'] = true
      end.converge(described_recipe)
    end

    context 'removing stock configuration files' do
      it 'deletes /etc/yum.repos.d/fedora-updates.repo' do
        expect(chef_run).to delete_file('/etc/yum.repos.d/fedora-updates.repo')
      end

      it 'deletes /etc/yum.repos.d/fedora-updates-testing.repo' do
        expect(chef_run).to delete_file('/etc/yum.repos.d/fedora-updates-testing.repo')
      end
    end

    %w(
      fedora
{'fraction_non_alphanumeric': 0.1777685262281432, 'fraction_numerical': 0.00041631973355537054, 'mean_word_length': 3.298747763864043, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3584269', 'n_tokens_mistral': 816, 'n_tokens_neox': 791, 'n_words': 120}