+-------------------+ +-------------------+ | Black Box Testing | | White Box Testing | +-------------------+ +-------------------+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// more: http://baylorrae.com/php-pubsub/ | |
class PubSub | |
{ | |
private static $events = array(); // all subscriptions | |
// Don't allow PubSub to be initialized outside this class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var events = require('events'); | |
var b = require('./b'); | |
var emitter = module.exports = new events.EventEmitter(); | |
module.exports.init = function(callback) { | |
b.init(function() { | |
emitter.emit('done'); | |
}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<!-- | |
MINDMAPEXPORTFILTER md;markdown Markdown | |
v. 0.1 | |
This code released under the GPL. : (http://www.gnu.org/copyleft/gpl.html) | |
Document : mm2markdown.xsl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
// ----------------- | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition | |
// -------------------------------------------------------------------- | |
// | |
// This is a options template for [JSHint][1], using [JSHint example][2] | |
// and [Ory Band's example][3] as basis and setting config values to | |
// be most strict: | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = chai.assert; | |
describe('Sinon', function() { | |
describe('spies', function() { | |
it('should keep count', function() { | |
// fill code here | |
spy(); | |
spy(); | |
spy(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir data | |
mkdir logs | |
echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$@" >> logs/mongod.log &' > mongod | |
chmod a+x mongod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Каждый сценарий должен иметь смысл и выполняться независимо от других сценариев. Это подразумевает что каждый сценарий должен иметь достаточно шагов Given для того чтобы создать необходимый контекст для выполнения теста. | |
- Создатели фич должны иметь возможность описать свои мысли в свободной форме, чтобы фича читалась натурально. Это означает что они могут использовать фразы отличающиеся друг от друга но подразумевающие один результат. Очень важно чтобы фичи не звучали как написанные роботом. | |
- При написании фич, сделайте упор на читабельность, в противном случае они будут выглядеть как программа или тех спецификация и мы хотим избежать этого любой ценой! Ведь если не программист с трудом может понять что происходит в фиче, зачем тогда вообще их писать? ( Ведь ВDD в первую очередь направлен на коммуникацию - если это отбросить то можно вернуть к старым добрым simpletest или codeception ) | |
- Старайтесь избегать технических деталей вроде "чистка очереди", "запуск back-end сервиса", "открытие браузреа на бе |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var testRetryCounter = 0; | |
var assert = chai.assert; | |
$.ajax = function(opts) { | |
testRetryCounter++; | |
setTimeout(opts.error, 0); | |
}; | |
describe('Data', function() { | |
describe('#sendData()', function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var testRetryCounter = 0; | |
var assert = chai.assert; | |
$.ajax = function(opts) { | |
testRetryCounter++; | |
setTimeout(opts.error, 0); | |
}; | |
var real_setTimeout = setTimeout; |