<commit_before>expect = chai.expect

describe 'util.coffee', ->

  describe 'getUrl', ->

    it "'http://redmine.com' should be 'http://redmine.com'", () ->
      url = util.getUrl("http://redmine.com")
      expect(url).to.equal("http://redmine.com")


    it "'https://redmine.com' should be 'https://redmine.com'", () ->
      url = util.getUrl("https://redmine.com")
      expect(url).to.equal("https://redmine.com")


    it "'http://redmine.com  ' should be 'http://redmine.com'", () ->
      url = util.getUrl("http://redmine.com  ")
      expect(url).to.equal("http://redmine.com")


    it "'http://redmine.com/' should be 'http://redmine.com'", () ->
      url = util.getUrl("http://redmine.com/")
      expect(url).to.equal("http://redmine.com")


    it "'http://redmine.com/redmine' should be 'http://redmine.com/redmine'", () ->
      url = util.getUrl("http://redmine.com/redmine")
      expect(url).to.equal("http://redmine.com/redmine")


    it "'http://redmine.com/redmine/' should be 'http://redmine.com/redmine'", () ->
      url = util.getUrl("http://redmine.com/redmine/")
      expect(url).to.equal("http://redmine.com/redmine")
<commit_msg>refactoring<commit_after>expect = chai.expect

describe 'util.coffee', ->

  describe 'getUrl', ->

    dataset = [
      'http://redmine.com'
      'https://redmine.com'
      'http://redmine.com  '
      'http://redmine.com/'
      'http://redmine.com/redmine'
      'http://redmine.com/redmine/'
    ]

    expects = [
      'http://redmine.com'
      'https://redmine.com'
      'http://redmine.com'
      'http://redmine.com'
      'http://redmine.com/redmine'
      'http://redmine.com/redmine'
    ]

    for data, i in dataset
      e = expects[i]

      it data + " should be" + e, () ->
        url = util.getUrl(data)
        expect(url).to.equal(e)

{'fraction_non_alphanumeric': 0.21729611384783798, 'fraction_numerical': 0.0, 'mean_word_length': 2.4232209737827715, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 6, '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': '5682560', 'n_tokens_mistral': 656, 'n_tokens_neox': 641, 'n_words': 89}