<commit_before>Screw.Unit(function() {
  describe('Array', function() {
    describe('that is empty', function() {
      var _array = null;
      
      before(function() {
        _array = [];
      });
      
      describe('when sent #collect with a block', function() {
        it('should not yield', function() {
          var yieldedValues = [];
          _array.collect(function(s) {
            yieldedValues[yieldedValues.length] = arguments;
          });
          expect(yieldedValues).to(equal, []);
        });
        
        it('should return itself', function() {
          var returnValue = _array.collect(function(s) { });
          expect(returnValue).to(equal, _array);
        });
      });
      
      describe('when sent #detect with a block', function() {
        it('should not yield', function() {
          var yieldedValues = [];
          _array.detect(function(s) {
            yieldedValues[yieldedValues.length] = arguments;
          });
          expect(yieldedValues).to(equal, []);
        });
        
        it('should return null', function() {
          var returnValue = _array.detect(function(s) { return false; });
          expect(returnValue).to(equal, null);
        });
        
        describe('and an "ifNone" argument', function() {
          var _ifNone = null;
          
          before(function() {
            _ifNone = function() { 'nothing here'; };
          });
          
          it('should not yield', function() {
            var yieldedValues = [];
            _array.detect(_ifNone, function(s) {
              yieldedValues[yieldedValues.length] = arguments;
            });
            expect(yieldedValues).to(equal, []);
          });
          
          it('should return the expected value', function() {
            var returnValue = _array.detect(_ifNone, function(s) { return false; });
            expect(returnValue).to(equal, _ifNone());
          });
        });
      });
      
      describe('when sent #each with a block', function() {
        it('should not yield', function() {
          var yieldedValues = [];
          _array.each(function(s) {
            yieldedValues[yieldedValues.length] = arguments;
          });
          expect(yieldedValues).to(equal, []);
        });
        
        it('should return itself', function() {
          var returnValue = _array.each(function(s) { });
          expect(returnValue).to(equal, _array);
        });
      });
      
      describe('when sent #eachWithIndex with a block', function() {
        it('should not yield', function() {
          var yieldedValues = [];
          _array.eachWithIndex(function(s, i) {
            yieldedValues[yieldedValues.length] = arguments;
          });
          expect(yieldedValues).to(equal, []);
        });
        
        it('should return itself', function() {
          var returnValue = _array.eachWithIndex(function(s, i) { });
          expect(returnValue).to(equal, _array);
        });
      });
      
      describe('when sent #find with a block', function() {
        it('should not yield', function() {
          var yieldedValues = [];
          _array.find(function(s) {
            yieldedValues[yieldedValues.length] = arguments;
          });
          expect(yieldedValues).to(equal, []);
        });
        
        it('should return null', function() {
          var returnValue = _array.find(function(s) { return false; });
          expect(returnValue).to(equal, null);
        });
        
        describe('and an "ifNone" argument', function() {
          var _ifNone = null;
          
          before(function() {
            _ifNone = function() { 'nothing here'; };
          });
          
          it('should not yield', function() {
            var yieldedValues = [];
            _array.find(_ifNone, function(s) {
              yieldedValues[yieldedValues.length] = arguments;
            });
            expect(yieldedValues).to(equal, []);
          });
          
          it('should return the expected value', function() {
            var returnValue = _array.find(_ifNone, function(s) { return false; });
            expect(returnValue).to(equal, _ifNone());
          });
        });<commit_msg>Fix bug in specs for Array#detect when passing ifNone argument, assert on literal return value, and use Screw.Unit's 'be_null' matcher instead of 'equal, null'<commit_after>Screw.Unit(function() {
  describe('Array', function() {
    describe('that is empty', function() {
      var _array = null;
      
      before(function() {
        _array = [];
      });
      
      describe('when sent #collect with a block', function() {
        it('should not yield', function() {
          var yieldedValues = [];
          _array.collect(function(s) {
            yieldedValues[yieldedValues.length] = arguments;
          });
          expect(yieldedValues).to(equal, []);
        });
        
        it('should return itself', function() {
          var returnValue = _array.collect(function(s) { });
          expect(returnValue).to(equal, _array);
        });
      });
      
      describe('when sent #detect with a block', function() {
        it('should not yield', function() {
          var yieldedValues = [];
          _array.detect(function(s) {
            yieldedValues[yieldedValues.length] = arguments;
          });
          expect(yieldedValues).to(equal, []);
        });
        
        it('should return null', function() {
          var returnValue = _array.detect(function(s) { return false; });
          expect(returnValue).to(be_null);
        });
        
        describe('and an "ifNone" argument', function() {
          var _ifNone = null;
          
          before(function() {
            _ifNone = function() { return 'nothing here'; };
          });
          
          it('should not yield', function() {
            var yieldedValues = [];
            _array.detect(_ifNone, function(s) {
              yieldedValues[yieldedValues.length] = arguments;
            });
            expect(yieldedValues).to(equal, []);
          });
          
          it('should return the expected value', function() {
            var returnValue = _array.detect(_ifNone, function(s) {
              return false;
            });
            expect(returnValue).to(equal, 'nothing here');
          });
        });
      });
      
      describe('when sent #each with a block', function() {
        it('should not yield', function() {
          var yieldedValues = [];
          _array.each(function(s) {
            yieldedValues[yieldedValues.length] = arguments;
          });
          expect(yieldedValues).to(equal, []);
        });
        
        it('should return itself', function() {
          var returnValue = _array.each(function(s) { });
          expect(returnValue).to(equal, _array);
        });
      });
      
      describe('when sent #eachWithIndex with a block', function() {
        it('should not yield', function() {
          var yieldedValues = [];
          _array.eachWithIndex(function(s, i) {
            yieldedValues[yieldedValues.length] = arguments;
          });
          expect(yieldedValues).to(equal, []);
        });
        
        it('should return itself', function() {
          var returnValue = _array.eachWithIndex(function(s, i) { });
          expect(returnValue).to(equal, _array);
        });
      });
      
      describe('when sent #find with a block', function() {
        it('should not yield', function() {
          var yieldedValues = [];
          _array.find(function(s) {
            yieldedValues[yieldedValues.length] = arguments;
          });
          expect(yieldedValues).to(equal, []);
        });
        
        it('should return null', function() {
          var returnValue = _array.find(function(s) { return false; });
          expect(returnValue).to(be_null);
        });
        
        describe('and an "ifNone" argument', function() {
          var _ifNone = null;
          
          before(function() {
            _ifNone = function() { return 'nothing here'; };
          });
          
          it('should not yield', function() {
            var yieldedValues = [];
            _array.find(_ifNone, function(s) {
              yieldedValues[yieldedValues.length] = arguments;
            });
            expect(yieldedValues).to(equal, []);
          });
          
          it('should return the expected value', function() {
            var returnValue = _array.find(_ifNone, function(s) {
              return false;
            });
            expect(returnValue).to(equal, 'nothing here');
          });
        });
{'fraction_non_alphanumeric': 0.13811390362001383, 'fraction_numerical': 0.0, 'mean_word_length': 1.7671451355661882, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5248248', 'n_tokens_mistral': 2293, 'n_tokens_neox': 2240, 'n_words': 473}