var vows = require('vows'),
    assert = require('assert'),
    path = require('path'),
    fs  = require('fs'),
    grunt = require('grunt');

grunt.loadTasks(path.join(__dirname, '../tasks'));

var tasks = [];

grunt.task.init([], {help: true});
Object.keys(grunt.task._tasks).forEach(function(name) {
    tasks.push(name);
});

tasks.sort();

//This is a placeholder to ensure we are exporting all defined tasks
var tests = {
    'should export tasks': {
        topic: function() {
            return tasks.length;
        },
        'and find 42 tasks': function(topic) {
            assert.equal(42, topic);
        }
    }
};


tasks.forEach(function(name) {
    tests['should have ' + name] = {
        topic: function() {
            return grunt.task._tasks[name]
        },
        'should be an object': function(topic) {
            assert.isObject(topic);
        }
    };
});


vows.describe('tasks').addBatch(tests).export(module);

@@ -542,17 +542,17 @@
 d find 4
-2
+3
  tasks':
@@ -600,9 +600,9 @@
 al(4
-2
+3
 , to
@@ -766,16 +766,17 @@
 ks%5Bname%5D
+;
 %0A       

Update tests to look for 43 tasks