<commit_before>require 'torquebox/server'

describe TorqueBox::Server do

  it "should expand relative paths" do
    java.lang.System.setProperty('jruby.home', '.')
    TorqueBox::Server.jruby_home.should == Dir.pwd
  end

  it "should return nil if torquebox-server is not installed" do
    TorqueBox::Server.torquebox_home.should == nil
  end<commit_msg>cleared the Gem paths before loading torquebox-server to make sure it's not there<commit_after>require 'torquebox/server'

describe TorqueBox::Server do

  it "should expand relative paths" do
    java.lang.System.setProperty('jruby.home', '.')
    TorqueBox::Server.jruby_home.should == Dir.pwd
  end

  it "should return nil if torquebox-server is not installed" do
    # if you have torquebox-server installed, this will actually return a 
    # value instead of nil.  so reseting gem paths.
    old_gem_home = ENV['GEM_HOME']
    old_gem_path = ENV['GEM_PATH']
    ENV['GEM_PATH'] = ""
    ENV['GEM_HOME'] = ""
    Gem.clear_paths

    TorqueBox::Server.torquebox_home.should == nil

    Gem.clear_paths
    ENV['GEM_HOME'] = old_gem_home
    ENV['GEM_PATH'] = old_gem_path
  end
{'fraction_non_alphanumeric': 0.10535557506584724, 'fraction_numerical': 0.0, 'mean_word_length': 3.892703862660944, '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': '6067822', 'n_tokens_mistral': 394, 'n_tokens_neox': 375, 'n_words': 97}