/*jslint node: true, vars: true, indent: 4 */
'use strict';

var Omnibus = require('../src/Omnibus'),
    vows = require('vows'),
    assert = require('assert');

vows.describe('Omnibus Elevator').addBatch({
    'peut etre instancié':{
        topic: new Omnibus(5),
        ' le cycle est de 5x2x3 étapes': function (o) {
            //console.log(o.cycle);
            assert.equal(o.cycle.length, 5*2*3);
        }
    }
}).export(module);
@@ -161,52 +161,784 @@
 ;%0A%0Av
-ows.describe('Omnibus Elevator').add
+ar upward = Array.apply(null, new Array(5)).map(function () %7B%0A    return %5B'UP', 'OPEN', 'CLOSE'%5D;%0A%7D);%0Avar downward = Array.apply(null, new Array(5)).map(function () %7B%0A    return %5B'DOWN', 'OPEN', 'CLOSE'%5D;%0A%7D);%0A%0Afunction appendCommands(batch)%7B%0A    var context = batch%5B'peut etre instanci%C3%A9'%5D;%0A    var cmd = %5B%5D.concat.apply(%5B%5D, upward.concat(downward)); //flatten%0A    cmd = cmd.concat(cmd);%0A    cmd.forEach(function (e, i)%7B%0A        var subtopic = context%5B'on appelle la commande ' + (i + 1)%5D = %7B%0A            topic : function (o) %7B%0A                return o.nextCommand();%0A            %7D%0A        %7D;%0A        subtopic%5B'on obtient %22' + e + '%22'%5D = function (res) %7B%0A            assert.equal(res, e);%0A        %7D;%0A    %7D);%0A    return batch;%0A%7D%0A%0Afunction create
 Batch(
+) 
 %7B%0A
+    var result = %7B%0A    
     
@@ -959,18 +959,23 @@
 tanci%C3%A9':
+ 
 %7B%0A
+    
         
@@ -1005,16 +1005,20 @@
         
+  
+  
 ' le cyc
@@ -1069,16 +1069,20 @@
         
+    
 //consol
@@ -1101,32 +1101,36 @@
 e);%0A            
+ 
+   
 assert.equal(o.c
@@ -1147,11 +1147,15 @@
 h, 5
-*2*
+ * 2 * 
 3);%0A
@@ -1166,17 +1166,126 @@
     
-%7D%0A    %7D%0A%7D
+    %7D%0A        %7D%0A    %7D;%0A    return  appendCommands(result);%0A%7D%0A%0Avows.describe('Omnibus Elevator').addBatch(createBatch()
 ).ex

add tests