diff --git a/nodejs-winston-0.7.2-Remove-stream-tests.patch b/nodejs-winston-0.7.2-Remove-stream-tests.patch new file mode 100644 index 0000000..c0d04ab --- /dev/null +++ b/nodejs-winston-0.7.2-Remove-stream-tests.patch @@ -0,0 +1,90 @@ +From ea1cd95a6df69d8159b1493663698b74ca41d4df Mon Sep 17 00:00:00 2001 +From: Jamie Nguyen +Date: Tue, 20 Aug 2013 22:28:43 +0100 +Subject: [PATCH] Remove stream tests + +--- + test/transports/transport.js | 60 -------------------------------------------- + 1 file changed, 60 deletions(-) + +diff --git a/test/transports/transport.js b/test/transports/transport.js +index fe1dbef..ca33475 100644 +--- a/test/transports/transport.js ++++ b/test/transports/transport.js +@@ -31,9 +31,6 @@ module.exports = function (transport, options) { + case 'file': + helpers.assertFile(transport); + break; +- case 'webhook': +- helpers.assertWebhook(transport); +- break; + case 'couchdb': + helpers.assertCouchdb(transport); + break; +@@ -47,63 +44,6 @@ module.exports = function (transport, options) { + assert.isNotNull(logged); + } + ), +- 'the stream() method': { +- 'using no options': { +- 'topic': function () { +- if (!transport.stream) return; +- +- logger.log('info', 'hello world', {}); +- +- var cb = this.callback, +- j = 10, +- i = 10, +- results = [], +- stream = logger.stream(); +- +- stream.on('log', function (log) { +- results.push(log); +- results.stream = stream; +- if (!--j) cb(null, results); +- }); +- +- stream.on('error', function (err) { +- j = -1; //don't call the callback again +- cb(err); +- }); +- +- while (i--) logger.log('info', 'hello world ' + i, {}); +- }, +- 'should stream logs': function (err, results) { +- if (!transport.stream) return; +- assert.isNull(err); +- results.forEach(function (log) { +- assert.ok(log.message.indexOf('hello world') === 0 +- || log.message.indexOf('test message') === 0); +- }); +- results.stream.destroy(); +- } +- }, +- 'using the `start` option': { +- 'topic': function () { +- if (!transport.stream) return; +- +- var cb = this.callback, +- stream = logger.stream({ start: 0 }); +- +- stream.on('log', function (log) { +- log.stream = stream; +- if (cb) cb(null, log); +- cb = null; +- }); +- }, +- 'should stream logs': function (err, log) { +- if (!transport.stream) return; +- assert.isNull(err); +- assert.isNotNull(log.message); +- log.stream.destroy(); +- } +- } +- }, + 'after the logs have flushed': { + topic: function () { + setTimeout(this.callback, 1000); +-- +1.8.3.1 + diff --git a/nodejs-winston.spec b/nodejs-winston.spec index fe9099d..9965246 100644 --- a/nodejs-winston.spec +++ b/nodejs-winston.spec @@ -12,6 +12,8 @@ Group: System Environment/Libraries URL: https://github.com/flatiron/winston Source0: http://registry.npmjs.org/winston/-/winston-%{version}.tgz +Patch0: %{name}-0.7.2-Remove-stream-tests.patch + BuildArch: noarch %if 0%{?fedora} >= 19 ExclusiveArch: %{nodejs_arches} noarch @@ -51,6 +53,7 @@ parts of the process to make it more flexible and extensible. %prep %setup -q -n package find . -type f -iname '*.js' -exec chmod -x '{}' \; +%patch0 -p1 %nodejs_fixdep request '~2.14' @@ -69,6 +72,7 @@ cp -pr package.json lib/ \ %if 0%{?enable_tests} %check %nodejs_symlink_deps --check +rm -f test/transports/webhook-test.js %{nodejs_sitelib}/vows/bin/vows --spec --isolate %endif