var assert = require('assert');
var after = require('after');
var Ready = require('./');

test('no callbacks', function() {
    Ready()();
});

test('single callback', function(done) {
    var ready = Ready();
    ready(function() {
        done();
    });

    ready();
});

test('multiple callbacks', function(done) {
    done = after(3, done);

    var ready = Ready();
    ready(done);
    ready(done);
    ready(done);

    ready();
});

test('ignore second trigger', function() {
    var count = 0;
    var ready = Ready();
    ready(function() {
        ++count;
    });

    ready();
    ready();
    ready();

    assert(count === 1);
});

test('fire immediately after trigger', function(done) {
    var ready = Ready();

    ready();

    ready(function() {
        done();
    });
});

@@ -121,23 +121,53 @@
 ) %7B%0A    
-Ready()
+var ready = Ready();%0A    ready.signal
 ();%0A%7D);%0A
@@ -282,32 +282,39 @@
   %7D);%0A%0A    ready
+.signal
 ();%0A%7D);%0A%0Atest('m
@@ -460,24 +460,31 @@
 ;%0A%0A    ready
+.signal
 ();%0A%7D);%0A%0Ates
@@ -617,32 +617,39 @@
   %7D);%0A%0A    ready
+.signal
 ();%0A    ready();
@@ -641,24 +641,31 @@
 );%0A    ready
+.signal
 ();%0A    read
@@ -657,32 +657,39 @@
 nal();%0A    ready
+.signal
 ();%0A%0A    assert(
@@ -781,32 +781,32 @@
 ady = Ready();%0A%0A
-
     ready();%0A%0A  
@@ -794,24 +794,31 @@
 ;%0A%0A    ready
+.signal
 ();%0A%0A    rea

Update test