<commit_before>require 'spec_helper'

describe 'python_dir', type: :fact do
  before { Facter.clear }

  describe 'python dir' do
    context 'default path' do
      before do
        Facter::Util::Resolution.stubs(:which).with('python').returns(true)
        Facter::Util::Resolution.stubs(:exec).with('python -c "import site; print site.getsitepackages()[0]"').returns('/usr/local/lib/python2.7/dist-packages')
      end
      it do
        expect(Facter.value(:python_dir)).to eq('/usr/local/lib/python2.7/dist-packages')
      end
    end
  end
end
<commit_msg>Updated spec test to reflect implementation<commit_after>require 'spec_helper'

describe 'python_dir', type: :fact do
  before { Facter.clear }

  describe 'python dir' do
    context 'default path' do
      before do
        Facter::Util::Resolution.stubs(:which).with('python').returns(true)
        Facter::Util::Resolution.stubs(:exec).with('python -c "import site; print(site.getsitepackages()[0])"').returns('/usr/local/lib/python2.7/dist-packages')
      end
      it do
        expect(Facter.value(:python_dir)).to eq('/usr/local/lib/python2.7/dist-packages')
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.14814814814814814, 'fraction_numerical': 0.008613264427217916, 'mean_word_length': 3.5214007782101167, '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': '3717472', 'n_tokens_mistral': 373, 'n_tokens_neox': 371, 'n_words': 74}