'use strict';

var Blink1 = require('node-blink1');

module.exports = function (options) {
    var self = this;

    this.jasmineStarted = function (suiteInfo) {
        try {
            self.blink1 = new Blink1();
            self.yellow();
            console.log("Blink1!", suiteInfo);
        } catch(e) {
            console.log(e);
        }
    };

    this.specDone = function (result) {
        console.log(result);
        if (result.failedExpectations.length > 0) {
            self.red();
        }
    };

    this.yellow = function () {
        self.blink1.fadeToRGB(100, 155, 155, 0);
    };

    this.red = function () {
        self.blink1.setRGB(255, 0, 0);
    };
};

//var Blink1 = require('node-blink1');
//var blink1 = new Blink1();
//blink1.fadeToRGB(300, 255, 0, 255, function () {
//    blink1.off();
//});

@@ -169,16 +169,47 @@
   try %7B%0A
+            self.fail = false;%0A
         
@@ -236,24 +236,24 @@
 w Blink1();%0A
-
             
@@ -425,37 +425,8 @@
 ) %7B%0A
-        console.log(result);%0A
     
@@ -469,24 +469,54 @@
 ngth %3E 0) %7B%0A
+            self.fail = true;%0A
             
@@ -537,32 +537,139 @@
       %7D%0A    %7D;%0A%0A
+    this.jasmineDone = function () %7B%0A        if (!self.fail) %7B%0A            self.green();%0A        %7D%0A    %7D;%0A%0A
     this.yellow 
@@ -762,32 +762,32 @@
 = function () %7B%0A
-
         self.bli
@@ -815,16 +815,94 @@
 ;%0A    %7D;
+%0A%0A    this.green = function () %7B%0A        self.blink1.setRGB(0, 255, 0);%0A    %7D;
 %0A%7D;%0A%0A//v

Switch to green at the end if all tests succeeded.