/* Global Includes */
var testCase   = require('mocha').describe;
var pre        = require('mocha').before;
var preEach    = require('mocha').beforeEach;
var post       = require('mocha').after;
var postEach   = require('mocha').afterEach;
var assertions = require('mocha').it;
var assert     = require('chai').assert;
var validator  = require('validator');
var exec = require('child_process').execSync;
var artik      = require('../lib/artik-sdk');


/* Test Specific Includes */
var media = artik.media();
var sound_file = '/usr/share/sounds/alsa/Front_Center.wav';

/* Test Case Module */
testCase('Media', function() {

	pre(function() {
	});

	testCase('#play_sound_file', function() {

		assertions('Play the sound file', function() {
			media.play_sound_file(sound_file, function(response, status) {
				console.log('Finished playing');
			});
		});

	});


	post(function() {
	});

});

@@ -560,16 +560,32 @@
 er.wav';
+%0Avar start, end;
 %0A%0A/* Tes
@@ -699,16 +699,60 @@
 tion() %7B
+%0A%09%09this.timeout(5000);%0A%09%09start = new Date();
 %0A%0A%09%09asse
@@ -790,20 +790,25 @@
 unction(
+done
 ) %7B%0A
+%0A
 %09%09%09media
@@ -873,38 +873,193 @@
 %09%09%09%09
-console.log('Finished playing'
+end = new Date();%0A%09%09%09%09var timeOfPlay = (end.getTime() - start.getTime())/1000;%0A%09%09%09%09console.log('Finished playing. Seconds ' + timeOfPlay);%0A%09%09%09%09assert.isAtLeast(timeOfPlay, 1);%0A%09%09%09%09done(
 );%0A%09

Use time duration of test to measure the success