<commit_before>_ = require 'underscore-plus'
path = require 'path'
os = require 'os'
Go = require './../lib/go'
PathExpander = require './../lib/util/pathexpander'
PathHelper = require './util/pathhelper'

describe "go", ->
  [go, pathexpander, pathhelper, env] = []

  beforeEach ->
    pathexpander = new PathExpander(process.env)
    pathhelper = new PathHelper()
    go = new Go('/usr/local/bin/go', pathexpander)

  describe "when working with a single-item gopath", ->
    beforeEach ->
      go.gopath = '~/go'

    it "expands the path", ->
      runs =>
        result = go.buildgopath()
        expect(false).toBe true
        expect(result).toBeDefined
        expect(result).toBeTruthy
        expect(result).toBe path.join(pathhelper.home(), 'go')

    it "splits the path", ->
      runs =>
        result = go.splitgopath()
        expect(result).toBeDefined
        expect(result).toBeTruthy
        expect(_.size(result)).toBe 1
        expect(result[0]).toBeDefined
        expect(result[0]).toBe path.join(pathhelper.home(), 'go')

  describe "when working with a multi-item gopath", ->
    beforeEach ->
      go.gopath = '~' + path.sep + 'go' + path.delimiter + '~' + path.sep + 'go2' + path.delimiter + path.sep + 'usr' + path.sep + 'local' + path.sep + 'go'

    it "expands the path", ->
      runs =>
        prefix = if os.platform() is 'win32' then 'c:' else ''
        result = go.buildgopath()
        expect(result).toBeDefined
        expect(result).toBeTruthy
        expected = path.join(pathhelper.home(), 'go') + path.delimiter + path.join(pathhelper.home(), 'go2') + path.delimiter + prefix + path.sep + 'usr' + path.sep + 'local' + path.sep + 'go'
        expect(result.toLowerCase()).toBe expected.toLowerCase()
<commit_msg>:rainbow: ... And Fix The Build Again<commit_after>_ = require 'underscore-plus'
path = require 'path'
os = require 'os'
Go = require './../lib/go'
PathExpander = require './../lib/util/pathexpander'
PathHelper = require './util/pathhelper'

describe "go", ->
  [go, pathexpander, pathhelper, env] = []

  beforeEach ->
    pathexpander = new PathExpander(process.env)
    pathhelper = new PathHelper()
    go = new Go('/usr/local/bin/go', pathexpander)

  describe "when working with a single-item gopath", ->
    beforeEach ->
      go.gopath = '~/go'

    it "expands the path", ->
      runs =>
        result = go.buildgopath()
        expect(result).toBeDefined
        expect(result).toBeTruthy
        expect(result).toBe path.join(pathhelper.home(), 'go')

    it "splits the path", ->
      runs =>
        result = go.splitgopath()
        expect(result).toBeDefined
        expect(result).toBeTruthy
        expect(_.size(result)).toBe 1
        expect(result[0]).toBeDefined
        expect(result[0]).toBe path.join(pathhelper.home(), 'go')

  describe "when working with a multi-item gopath", ->
    beforeEach ->
      go.gopath = '~' + path.sep + 'go' + path.delimiter + '~' + path.sep + 'go2' + path.delimiter + path.sep + 'usr' + path.sep + 'local' + path.sep + 'go'

    it "expands the path", ->
      runs =>
        prefix = if os.platform() is 'win32' then 'c:' else ''
        result = go.buildgopath()
        expect(result).toBeDefined
        expect(result).toBeTruthy
        expected = path.join(pathhelper.home(), 'go') + path.delimiter + path.join(pathhelper.home(), 'go2') + path.delimiter + prefix + path.sep + 'usr' + path.sep + 'local' + path.sep + 'go'
        expect(result.toLowerCase()).toBe expected.toLowerCase()

{'fraction_non_alphanumeric': 0.16040955631399317, 'fraction_numerical': 0.003981797497155859, 'mean_word_length': 2.7295864262990457, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '6570187', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1130, 'n_words': 259}