'use strict';
var Graph = require('../').Structure.Graph;
var GremlinScript = require('../').GremlinScript;
var bind = require('../').bindParameter;


describe('GremlinScript', function() {
  describe('.line(String)', function() {
    it('should append a new line', function() {
      var gremlin = new GremlinScript();

      gremlin.line('g.v(1)');
      gremlin.script.should.equal('g.v(1)\n');
    });
  });

  describe('.line(String, ...parameters)', function() {
    it('should append a new line with a bound parameter', function() {
      var gremlin = new GremlinScript();

      gremlin.line('g.v(%s)', 1);
      gremlin.script.should.equal('g.v(p0)\n');
      gremlin.params.p0.should.equal(1);
    });

    it('should append a new line with multiple bound parameters', function() {
      var gremlin = new GremlinScript();

      gremlin.line('g.V(%s, %s)', 'name', 'Alice');
      gremlin.script.should.equal('g.V(p0, p1)\n');
      gremlin.params.p0.should.equal('name');
      gremlin.params.p1.should.equal('Alice');
    });
  });

  describe('.line(Helper)', function() {
    it('should append a new line', function() {
      var gremlin = new GremlinScript();
      var g = new Graph('g');

      gremlin.line(g.v(1));
      gremlin.script.should.equal('g.v(1)\n');
    });
  });

  describe('.var(Helper)', function() {
    it('should identify an object with an automatic identifier', function() {
      var gremlin = new GremlinScript();
      var g = new Graph('g');

      gremlin.var(g.v(1));
      gremlin.script.should.equal('i0=g.v(1)\n');
    });
  });

  describe('.var(Helper[, identifier])', function() {
    it('should identify an object with a custom identifier', function() {
      var gremlin = new GremlinScript();
      var g = new Graph('g');

      gremlin.var(g.v(1), 'v1');
      gremlin.script.should.equal('v1=g.v(1)\n');
    });
  });

  describe('Bound parameters with helpers', function() {
    it('should handle bound parameters', function() {
      var gremlin = new GremlinScript();
      var g = new Graph('g');

      gremlin.line(g.v(bind(1)));
      gremlin.script.should.equal('g.v(p0)\n');
      gremlin.params.p0.should.equal(1);
    });
  });
});
@@ -1950,16 +1950,18 @@
  handle 
+a 
 bound pa
@@ -1959,33 +1959,32 @@
  bound parameter
-s
 ', function() %7B%0A
@@ -2129,32 +2129,32 @@
 l('g.v(p0)%5Cn');%0A
-
       gremlin.pa
@@ -2181,22 +2181,393 @@
 (1);%0A    %7D);
+%0A%0A    it('should handle multiple bound parameters', function() %7B%0A      var gremlin = new GremlinScript();%0A      var g = new Graph('g');%0A%0A      gremlin.line(g.V('name', bind('Alice')).has('age', bind(28)));%0A      gremlin.script.should.equal(%22g.V('name',p0).has('age',p1)%5Cn%22);%0A      gremlin.params.p0.should.equal('Alice');%0A      gremlin.params.p1.should.equal(28);%0A    %7D);
 %0A  %7D);%0A%7D);

Add a test when using multiple bound parameters with helpers