'use strict';

/**
 * Attempt to create a template containing an ec2 and elasticache instance.
 **/
var Template = require('../lib/Template.js');
var Validator = require('../lib/Validator.js');

exports.testJustEC2 = function(test){
    // Set up the template
    var t = new Template();
    var filePath = '/tmp/minimum_valid_test_template.json';

     t.ec2Instance('TestInstance')
        .imageId('ami-123456')
        .keyName('test-key')
        .name('TestInstance');

    t.elastiCacheCluster('TestECC')
        .autoMinorVersionUpgrade('true')
        .cacheNodeType('cache.m3.medium')
        .engine('memcached')
        .numCacheNodes(1);

    t.save(filePath);

    // Assertions
    test.expect(2);

    function validationCallback(isValid, message){
        test.ok(isValid);
        test.ok(!!message);
        test.done();
    }

    var v = new Validator(filePath);
    v.validate(validationCallback);
};

@@ -62,16 +62,8 @@
  an 
-ec2 and 
 elas
@@ -80,16 +80,16 @@
 stance.%0A
+
  **/%0Avar
@@ -229,14 +229,14 @@
  // 
-Set up
+Create
  the
@@ -302,21 +302,19 @@
 tmp/
-minimum_valid
+elasticache
 _tes
@@ -336,135 +336,8 @@
 ';%0A%0A
-     t.ec2Instance('TestInstance')%0A        .imageId('ami-123456')%0A        .keyName('test-key')%0A        .name('TestInstance');%0A%0A
     
@@ -542,18 +542,29 @@
  // 
-Assertions
+Validate the template
 %0A   

Remove EC2 instance from the elasticache test