/*jshint expr: true*/
'use strict';
require('should');

describe('actions', function(){

  var actions;

  beforeEach(function(){
    actions = require('../classes/actions.js').new();
  });

  describe('when adding "Bua" cry', function(){
    it('should add corresponding "Alimentar" action', function(){
      actions.add('Bua');
      actions.should.have.lengthOf(1);
      actions[0].should.be.exactly('Alimentar');
    });
  });

  describe('when adding "Mua" cry', function(){
    it('should add corresponding "Pañal" action', function(){
      actions.add('Mua');
      actions.should.have.lengthOf(1);
      actions[0].should.be.exactly('Pañal');
    });
  });

  describe('when adding "Gua" cry', function(){
    it('should add corresponding "Chupón" action', function(){
      actions.add('Gua');
      actions.should.have.lengthOf(1);
      actions[0].should.be.exactly('Chupón');
    });
  });

  describe('when adding "Mua-Bua" cry', function(){
    it('should add special case "Pañal Alimentar" action', function(){
      actions.add('Mua');
      actions.add('Bua');
      actions.should.have.lengthOf(1);
      actions[0].should.be.exactly('Pañal Alimentar');
    });
  });

  describe('when adding "Bua-Gua" cry', function(){
    it('should add special case "Alimentar Chupón" action', function(){
      actions.add('Bua');
      actions.add('Gua');
      actions.should.have.lengthOf(1);
      actions[0].should.be.exactly('Alimentar Chupón');
    });
  });

  describe('when adding "Bua-Gua-Bua-Mua" cry', function(){
    it('should add special case "Alimentar - Chupón Alimentar Pañal" action', function(){
      actions.add('Bua');
      actions.add('Gua');
      actions.add('Bua');
      actions.add('Mua');
      actions.should.have.lengthOf(2);
      actions.toString().should.be.exactly('Alimentar - Chupón Alimentar Pañal');
    });
  });

  describe('when adding "Gua-Bua-Mua" cry', function(){
    it('should add special case "Chupón Alimentar Pañal" action', function(){
      actions.add('Gua');
      actions.add('Bua');
      actions.add('Mua');
      actions.should.have.lengthOf(1);
      actions[0].should.be.exactly('Chupón Alimentar Pañal');
    });
  });

  describe('when transforming actions to string', function(){
    it('should concatenate actions like "Action - Action2"', function(){
      actions.push('Action');
      actions.push('Action2');
      actions.toString().should.be.exactly('Action - Action2');
    });
  });
});

@@ -316,32 +316,33 @@
 ons.add('Bua');%0A
+%0A
       actions.sh
@@ -373,35 +373,32 @@
      actions
-%5B0%5D
 .should.
 be.exactly('
@@ -381,34 +381,31 @@
 ions.should.
-be.exactly
+include
 ('Alimentar'
@@ -550,32 +550,33 @@
 ons.add('Mua');%0A
+%0A
       actions.sh
@@ -607,35 +607,32 @@
      actions
-%5B0%5D
 .should.
 be.exactly('
@@ -615,34 +615,31 @@
 ions.should.
-be.exactly
+include
 ('Pa%C3%B1al');%0A 
@@ -781,32 +781,33 @@
 ons.add('Gua');%0A
+%0A
       actions.sh
@@ -838,35 +838,32 @@
      actions
-%5B0%5D
 .should.
 be.exactly('
@@ -846,34 +846,31 @@
 ions.should.
-be.exactly
+include
 ('Chup%C3%B3n');%0A
@@ -1107,35 +1107,32 @@
      actions
-%5B0%5D
 .should.
 be.exactly('
@@ -1119,26 +1119,23 @@
 .should.
-be.exactly
+include
 ('Pa%C3%B1al 
@@ -1330,32 +1330,33 @@
 ons.add('Gua');%0A
+%0A
       actions.sh
@@ -1387,35 +1387,32 @@
      actions
-%5B0%5D
 .should.
 be.exactly('
@@ -1395,34 +1395,31 @@
 ions.should.
-be.exactly
+include
 ('Alimentar 
@@ -1689,32 +1689,33 @@
 ons.add('Mua');%0A
+%0A
       actions.sh
@@ -2038,32 +2038,33 @@
 ons.add('Mua');%0A
+%0A
       actions.sh
@@ -2103,19 +2103,16 @@
 ions
-%5B0%5D
 .should.
 be.e
@@ -2107,26 +2107,23 @@
 .should.
-be.exactly
+include
 ('Chup%C3%B3n

Refactor actions test