<commit_before># frozen_string_literal: true

describe Facter::Resolvers::OsRelease do
  after do
    Facter::Resolvers::OsRelease.invalidate_cache
  end

  before do
    allow(Facter::Util::FileHelper).to receive(:safe_readlines)
      .with('/etc/os-release')
      .and_return(os_release_content)
  end

  context 'when on Ubuntu' do
    let(:os_release_content) { load_fixture('os_release').readlines }

    it 'returns os NAME' do
      result = Facter::Resolvers::OsRelease.resolve(:name)

      expect(result).to eq('Ubuntu')
    end

    it 'returns os PRETTY_NAME' do
      result = Facter::Resolvers::OsRelease.resolve(:pretty_name)<commit_msg>(FACT-2995) Fix order dependent test<commit_after># frozen_string_literal: true

describe Facter::Resolvers::OsRelease do
  after do
    Facter::Resolvers::OsRelease.invalidate_cache
  end

  before do
    Facter::Resolvers::OsRelease.invalidate_cache
    allow(Facter::Util::FileHelper).to receive(:safe_readlines)
      .with('/etc/os-release')
      .and_return(os_release_content)
  end

  context 'when on Ubuntu' do
    let(:os_release_content) { load_fixture('os_release').readlines }

    it 'returns os NAME' do
      result = Facter::Resolvers::OsRelease.resolve(:name)

      expect(result).to eq('Ubuntu')
    end

    it 'returns os PRETTY_NAME' do
      result = Facter::Resolvers::OsRelease.resolve(:pretty_name)
{'fraction_non_alphanumeric': 0.11585807385952208, 'fraction_numerical': 0.002896451846488052, 'mean_word_length': 4.2748091603053435, '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': '6802550', 'n_tokens_mistral': 474, 'n_tokens_neox': 442, 'n_words': 86}