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

describe "rvm paths" do
  include_context "Capistrano::Configuration"

  describe "default values" do
    before { @configuration.trigger(:load) }

    it "should return default system path" do
      @configuration.fetch(:rvm_system_path).should == '/usr/local/rvm'
    end

    it "should return default user path" do
      @configuration.fetch(:rvm_user_path).should == '$HOME/.rvm'
    end

    it "should return default installation mode" do
      @configuration.fetch(:rvm_type).should == :user
    end

    it "should return default path" do
      @configuration.fetch(:rvm_path).should == '$HOME/.rvm'
    end

    it "should return default bin path" do
      @configuration.fetch(:rvm_bin_path).should == '$HOME/.rvm/bin'
    end

    it "should return default gemset path" do
      @configuration.fetch(:rvm_gemset_path).should == '$HOME/.rvm/gemsets'
    end
  end

  describe "system mode" do
    before do
      @configuration.set(:rvm_type, :system)
      @configuration.trigger(:load)
    end

    it "should return default path" do
      @configuration.fetch(:rvm_path).should == '/usr/local/rvm'
    end

    it "should return system bin path" do
      @configuration.fetch(:rvm_bin_path).should == '/usr/local/rvm/bin'
    end

    it "should return system gemset path" do
      @configuration.fetch(:rvm_gemset_path).should == '/usr/local/rvm/gemsets'
    end
  end

  describe "invalid configuration values" do
    context "in :mixed mode" do
      before { @configuration.set(:rvm_type, :mixed) }

      it "should abort if rvm_type is :mixed and rvm_user empty" do
        expect { @configuration.trigger(:load) }.to \
          abort_with_error(/When rvm_type is :mixed, you must also set rvm_user/)
      end

      it "should abort if rvm_user isn't an Array" do
        @configuration.set(:rvm_user, "a string")
        expect { @configuration.trigger(:load) }.to \
          abort_with_error(/rvm_user must be an Array/)
      end

      it "should abort if rvm_user contains an invalid value" do
        @configuration.set(:rvm_user, [ :invalid_value ])
        expect { @configuration.trigger(:load) }.to \
          abort_with_error(/Invalid value\(s\) in rvm_user: invalid_value/)
      end

      it "should abort if rvm_user mixes :none with other values" do
        @configuration.set(:rvm_user, [ :none, :gemsets ])
        expect { @configuration.trigger(:load) }.to \
          abort_with_error(/rvm_user cannot mix :none with other values/)
      end

      it "should abort if rvm_user mixes :all with other values" do
        @configuration.set(:rvm_user, [ :gemsets, :all ])
        expect { @configuration.trigger(:load) }.to \
          abort_with_error(/rvm_user cannot mix :all with other values/)
      end
    end

    it "should abort if rvm_user is set and rvm_type isn't :mixed" do
      @configuration.set(:rvm_user, [ :gemsets ])
      expect { @configuration.trigger(:load) }.to \
        abort_with_error(/rvm_user must not be set unless rvm_type is :mixed/)
    end
  end
end<commit_msg>update rvm paths specs passing to rspec 3 syntax<commit_after>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "rvm paths" do
  include_context "Capistrano::Configuration"

  describe "default values" do
    before { @configuration.trigger(:load) }

    it "should return default system path" do
      @configuration.fetch(:rvm_system_path).should == '/usr/local/rvm'
    end

    it "should return default user path" do
      @configuration.fetch(:rvm_user_path).should == '$HOME/.rvm'
    end

    it "should return default installation mode" do
      @configuration.fetch(:rvm_type).should == :user
    end

    it "should return default path" do
      @configuration.fetch(:rvm_path).should == '$HOME/.rvm'
    end

    it "should return default bin path" do
      @configuration.fetch(:rvm_bin_path).should == '$HOME/.rvm/bin'
    end

    it "should return default gemset path" do
      @configuration.fetch(:rvm_gemset_path).should == '$HOME/.rvm/gemsets'
    end
  end

  describe "system mode" do
    before do
      @configuration.set(:rvm_type, :system)
      @configuration.trigger(:load)
    end

    it "should return default path" do
      @configuration.fetch(:rvm_path).should == '/usr/local/rvm'
    end

    it "should return system bin path" do
      @configuration.fetch(:rvm_bin_path).should == '/usr/local/rvm/bin'
    end

    it "should return system gemset path" do
      @configuration.fetch(:rvm_gemset_path).should == '/usr/local/rvm/gemsets'
    end
  end

  describe "invalid configuration values" do
    context "in :mixed mode" do
      before { @configuration.set(:rvm_type, :mixed) }

      it "should abort if rvm_type is :mixed and rvm_user empty" do
        lambda { @configuration.trigger(:load) }.should \
          raise_error(/When rvm_type is :mixed, you must also set rvm_user/)
      end

      it "should abort if rvm_user isn't an Array" do
        @configuration.set(:rvm_user, "a string")
        lambda { @configuration.trigger(:load) }.should \
          raise_error(/rvm_user must be an Array/)
      end

      it "should abort if rvm_user contains an invalid value" do
        @configuration.set(:rvm_user, [ :invalid_value ])
        lambda { @configuration.trigger(:load) }.should \
          raise_error(/Invalid value\(s\) in rvm_user: invalid_value/)
      end

      it "should abort if rvm_user mixes :none with other values" do
        @configuration.set(:rvm_user, [ :none, :gemsets ])
        lambda { @configuration.trigger(:load) }.should \
          raise_error(/rvm_user cannot mix :none with other values/)
      end

      it "should abort if rvm_user mixes :all with other values" do
        @configuration.set(:rvm_user, [ :gemsets, :all ])
        lambda { @configuration.trigger(:load) }.should \
          raise_error(/rvm_user cannot mix :all with other values/)
      end
    end

    it "should abort if rvm_user is set and rvm_type isn't :mixed" do
      @configuration.set(:rvm_user, [ :gemsets ])
      lambda { @configuration.trigger(:load) }.should \
        raise_error(/rvm_user must not be set unless rvm_type is :mixed/)
    end
  end
end
{'fraction_non_alphanumeric': 0.1099601593625498, 'fraction_numerical': 0.00015936254980079682, 'mean_word_length': 2.9005593536357988, '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': '2449554', 'n_tokens_mistral': 1951, 'n_tokens_neox': 1892, 'n_words': 559}