<commit_before>var assert = require('assert'),
    Grape  = require('../grape/grape.js')

describe("Grape.JS", function() {
  it("Extracts the arguments correctly", function() {
    var test_function = function(hello,world) {}
    var instance = new Grape({})

    assert.equal(instance.extractArguments(test_function).length,2)
    assert.equal(instance.extractArguments(test_function)[0],'hello')
    assert.equal(instance.extractArguments(test_function)[1],'world')
  })

  it("Correctly injects the relevent arguments", function() {
    var test_function = function($first,$third, $second) {
      return [$first,$third,$second]
    }

    var instance = new Grape({'$first':'hello','$second':'world'}),
        injected = instance.inject(test_function)

    assert.equal(injected[0], 'hello')
    assert.equal(injected[1], undefined)
    assert.equal(injected[2], 'world')
  })
})

// var Grape = function(dependencies) {
//   this.FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m
//   this.dependencies = dependencies || {}
// }

// Grape.prototype.getDependencies = function(array, dependencies) {
//   return array.map(function(dependencyName) {
//     return dependencies[dependencyName]
//   })
// }

// Grape.prototype.extractArguments = function(callback) {
//   return callback.toString()
//                  .match(this.FN_ARGS)[1]
//                  .split(', ').join(',')
//                  .split(',')
// }

// Grape.prototype.inject = function(callback) {
//   var args = this.extractArguments(callback)

//   return callback.apply(callback, this.getDependencies(args, this.dependencies))
// }<commit_msg>Removed dud comments in the test file<commit_after>var assert = require('assert'),
    Grape  = require('../grape/grape.js')

describe("Grape.JS", function() {
  it("Extracts the arguments correctly", function() {
    var test_function = function(hello,world) {}
    var instance = new Grape({})

    assert.equal(instance.extractArguments(test_function).length,2)
    assert.equal(instance.extractArguments(test_function)[0],'hello')
    assert.equal(instance.extractArguments(test_function)[1],'world')
  })

  it("Correctly injects the relevent arguments", function() {
    var test_function = function($first,$third, $second) {
      return [$first,$third,$second]
    }

    var instance = new Grape({'$first':'hello','$second':'world'}),
        injected = instance.inject(test_function)

    assert.equal(injected[0], 'hello')
    assert.equal(injected[1], undefined)
    assert.equal(injected[2], 'world')
  })
})
{'fraction_non_alphanumeric': 0.17570754716981132, 'fraction_numerical': 0.005110062893081761, 'mean_word_length': 3.866156787762906, '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': '3982568', 'n_tokens_mistral': 803, 'n_tokens_neox': 764, 'n_words': 129}