<commit_before>
describe 'Space.Module', ->

  beforeEach ->
    # Reset published space modules
    Space.Module.published = {}

  it 'extends space object', -> expect(Space.Module).to.extend Space.Object

  describe '@publish', ->

    it 'adds given module to the static collection of published modules', ->
      fakeModule = identifier = 'test'
      Space.Module.publish fakeModule, fakeModule.identifier
      expect(Space.Module.published[fakeModule.identifier]).to.equal fakeModule

    it 'throws an error if two modules try to publish under same name', ->
      publishTwoModulesWithSameName = ->
        Space.Module.publish {}, 'test'
        Space.Module.publish {}, 'test'
      expect(publishTwoModulesWithSameName).to.throw Error

  describe '@require', ->

    it 'returns published module for given identifier', ->
      fakeModule = identifier = 'test'
      Space.Module.publish fakeModule, fakeModule.identifier
      requiredModule = Space.Module.require fakeModule.identifier
      expect(requiredModule).to.equal fakeModule
<commit_msg>use real module classes for testing publish / require<commit_after>
describe 'Space.Module', ->

  beforeEach ->
    # Reset published space modules
    Space.Module.published = {}

  it 'extends space object', -> expect(Space.Module).to.extend Space.Object

  describe '@publish', ->

    it 'adds given module to the static collection of published modules', ->
      module = Space.Module.define 'test'
      expect(Space.Module.published['test']).to.equal module

    it 'throws an error if two modules try to publish under same name', ->
      publishTwoModulesWithSameName = ->
        Space.Module.define 'test'
        Space.Module.define 'test'
      expect(publishTwoModulesWithSameName).to.throw Error

  describe '@require', ->

    it 'returns published module for given identifier', ->
      module = Space.Module.define 'test'
      requiredModule = Space.Module.require 'test'
      expect(requiredModule).to.equal module

{'fraction_non_alphanumeric': 0.1046046046046046, 'fraction_numerical': 0.0, 'mean_word_length': 3.326839826839827, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '3841714', 'n_tokens_mistral': 518, 'n_tokens_neox': 505, 'n_words': 153}