define(['mout/function/throttle'], function(throttle){

    describe('function/throttle', function(){

        // IMPORTANT: setTimeout behavior can be very misleading (specially in
        // FF18 and IE 7-8) so we avoid using it on the tests.

        it('should execute callback only once per interval', function(){
            var count = 0;
            var start = new Date();
            var cb = throttle(function(){
                count++;
            }, 50);
            var limit = 120;
            while((new Date() - start) < limit) {
                cb();
            }
            expect( count ).toBe( 3 );
        });


        it('should allow passing args and should use first supplied value by default', function () {
            var count = 0;
            var cb = throttle(function(a, b){
                count += a + b;
            }, 50);
            var start = new Date();
            var limit = 120;
            cb(1,2);
            cb(3,4);
            expect( count ).toBe( 3 );
            while ((new Date() - start) < limit) {
                cb(1,1);
            }
            expect( count ).toBe( 7 );
        });

        it('should return first value', function () {
            var cb = throttle(function(val){
                return val;
            }, 50);
            expect( cb('x') ).toEqual( 'x' );
            expect( cb('x') ).toEqual( cb('y') );
        });


    });

});

@@ -589,39 +589,204 @@
         
-expect( count ).toBe( 3
+// we compare using greaterThan/lessThan to avoid issues on%0A            // travis-ci (see #41)%0A            expect( count ).toBeGreaterThan( 1 );%0A            expect( count ).toBeLessThan( 4
  );%0A    
@@ -1273,31 +1273,196 @@
     
-expect( count ).toBe( 7
+// we compare using greaterThan/lessThan to avoid issues on%0A            // travis-ci (see #41)%0A            expect( count ).toBeGreaterThan( 3 );%0A            expect( count ).toBeLessThan( 8
  );%0A
@@ -1486,22 +1486,42 @@
     it('
-should
+throttled fn should always
  return 
@@ -1526,16 +1526,25 @@
 n first 
+returned 
 value', 

change function/throttle spec trying to fix travis-ci flakiness. see #41