<commit_before>describe 'Scope', ->

  scope = null
  context = {}

  beforeEach ->
    scope = new Neck.Scope context

  it 'throw error when no context given', ->
    assert.throws -> new Neck.Scope()

  it 'not throw error when context given', ->
    assert.doesNotThrow -> new Neck.Scope {}

  it 'have own properties', ->
    assert.ok scope.hasOwnProperty "_resolvers"
    assert.ok scope.hasOwnProperty "_childs"
    assert.ok scope.hasOwnProperty "_callbacks"
    assert.ok scope.hasOwnProperty "listeningTo"
    assert.ok scope.hasOwnProperty "listeningToOnce"
  
  it 'create child scope', ->
    child = scope.child()
    assert.equal child.parent, scope
    assert.include scope._childs, child

    assert.ok child.hasOwnProperty "_resolvers"
    assert.ok child.hasOwnProperty "_childs"
    assert.ok child.hasOwnProperty "_callbacks"
    assert.ok child.hasOwnProperty "listeningTo"
    assert.ok child.hasOwnProperty "listeningToOnce"

  it 'release self and children', ->
    scope.release()
    assert.isUndefined scope._childs
    assert.equal scope.listeningToOnce, undefined
    assert.equal scope.listeningTo, undefined
    assert.deepEqual scope._callbacks, {}

  describe 'Properties', ->

    it 'parse string for eval', ->
      testCases =
        "true": "true"
        "false": "false"
        "test" : "scope.test"
        "123": "123"
        "123.23": "123.23"
        "test1 + 123.23": "scope.test1 + 123.23"
        "test + test": "scope.test + scope.test"
        "test1 + 'test2 + test3'": "scope.test1 + 'test2 + test3'"
        "@test": "context.test"
        "test + @test": "scope.test + context.test"<commit_msg>Change tests for new version of releasing scope<commit_after>describe 'Scope', ->

  scope = null
  context = {}

  beforeEach ->
    scope = new Neck.Scope context

  it 'throw error when no context given', ->
    assert.throws -> new Neck.Scope()

  it 'not throw error when context given', ->
    assert.doesNotThrow -> new Neck.Scope {}

  it 'have own properties', ->
    assert.ok scope.hasOwnProperty "_resolvers"
    assert.ok scope.hasOwnProperty "_childs"
    assert.ok scope.hasOwnProperty "_callbacks"
    assert.ok scope.hasOwnProperty "listeningTo"
    assert.ok scope.hasOwnProperty "listeningToOnce"
  
  it 'create child scope', ->
    child = scope.child()
    assert.equal child.parent, scope
    assert.include scope._childs, child

    assert.ok child.hasOwnProperty "_resolvers"
    assert.ok child.hasOwnProperty "_childs"
    assert.ok child.hasOwnProperty "_callbacks"
    assert.ok child.hasOwnProperty "listeningTo"
    assert.ok child.hasOwnProperty "listeningToOnce"

  it 'release self and children', ->
    scope.release()
    assert.equal 0, scope._childs.length
    assert.equal scope.listeningToOnce, undefined
    assert.equal scope.listeningTo, undefined
    assert.deepEqual scope._callbacks, {}

  describe 'Properties', ->

    it 'parse string for eval', ->
      testCases =
        "true": "true"
        "false": "false"
        "test" : "scope.test"
        "123": "123"
        "123.23": "123.23"
        "test1 + 123.23": "scope.test1 + 123.23"
        "test + test": "scope.test + scope.test"
        "test1 + 'test2 + test3'": "scope.test1 + 'test2 + test3'"
        "@test": "context.test"
        "test + @test": "scope.test + context.test"
{'fraction_non_alphanumeric': 0.12507480550568523, 'fraction_numerical': 0.02064631956912029, 'mean_word_length': 2.8872093023255814, 'pattern_counts': {'":': 18, '<': 3, '<?xml version=': 0, '>': 25, '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': '7283546', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1029, 'n_words': 267}