<commit_before>require File.expand_path('../../spec_helper', __FILE__)

module Pod

  describe Config do
    before do
      @sut = Config.new(false)
    end

    #-------------------------------------------------------------------------#

    describe "In general" do

      it "returns the singleton config instance" do
        @sut.should.be.instance_of Config
      end

      it "returns the path to the home dir" do
        @sut.home_dir.should == Pathname.new("~/.cocoapods").expand_path
      end

      it "returns the path to the spec-repos dir" do
        @sut.repos_dir.should == Pathname.new("~/.cocoapods/repos").expand_path
      end

      it "returns the path to the deprecated spec-repos dir" do
        @sut.old_repos_dir.should == Pathname.new("~/.cocoapods").expand_path
      end

      it "allows to specify whether the aggressive cache should be used with an environment variable" do
        @sut.aggressive_cache = false
        ENV['CP_AGGRESSIVE_CACHE'] = 'TRUE'
        @sut.aggressive_cache?.should.be.true
        ENV.delete('CP_AGGRESSIVE_CACHE')
      end

      it "allows to specify the home dir with an environment variable" do
        ENV['CP_HOME_DIR'] = '~/custom_home_dir'
        @sut.home_dir.should == Pathname.new("~/custom_home_dir").expand_path
        ENV.delete('CP_HOME_DIR')
      end

      it "allows to specify the repos dir with an environment variable" do
        ENV['CP_REPOS_DIR'] = '~/custom_repos_dir'
        @sut.repos_dir.should == Pathname.new("~/custom_repos_dir").expand_path
        ENV.delete('CP_REPOS_DIR')
      end
    end

    #-------------------------------------------------------------------------#

    describe "Paths" do

      it "returns the working directory as the installation root if a Podfile can be found" do
        Dir.chdir(temporary_directory) do
          File.open("Podfile", "w") {}<commit_msg>Remove an incorrect unit test.<commit_after>require File.expand_path('../../spec_helper', __FILE__)

module Pod

  describe Config do
    before do
      @sut = Config.new(false)
    end

    #-------------------------------------------------------------------------#

    describe "In general" do

      it "returns the singleton config instance" do
        @sut.should.be.instance_of Config
      end

      it "returns the path to the home dir" do
        @sut.home_dir.should == Pathname.new("~/.cocoapods").expand_path
      end

      it "returns the path to the spec-repos dir" do
        @sut.repos_dir.should == Pathname.new("~/.cocoapods/repos").expand_path
      end

      it "allows to specify whether the aggressive cache should be used with an environment variable" do
        @sut.aggressive_cache = false
        ENV['CP_AGGRESSIVE_CACHE'] = 'TRUE'
        @sut.aggressive_cache?.should.be.true
        ENV.delete('CP_AGGRESSIVE_CACHE')
      end

      it "allows to specify the home dir with an environment variable" do
        ENV['CP_HOME_DIR'] = '~/custom_home_dir'
        @sut.home_dir.should == Pathname.new("~/custom_home_dir").expand_path
        ENV.delete('CP_HOME_DIR')
      end

      it "allows to specify the repos dir with an environment variable" do
        ENV['CP_REPOS_DIR'] = '~/custom_repos_dir'
        @sut.repos_dir.should == Pathname.new("~/custom_repos_dir").expand_path
        ENV.delete('CP_REPOS_DIR')
      end
    end

    #-------------------------------------------------------------------------#

    describe "Paths" do

      it "returns the working directory as the installation root if a Podfile can be found" do
        Dir.chdir(temporary_directory) do
          File.open("Podfile", "w") {}
{'fraction_non_alphanumeric': 0.17527472527472526, 'fraction_numerical': 0.0, 'mean_word_length': 1.9795417348608837, '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': '3481810', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1018, 'n_words': 285}