From 9fe4bfe3dec52b982a908bab0036b13317c3810f Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Feb 22 2016 14:20:17 +0000 Subject: import nodejs010-nodejs-object-assign-4.0.1-5.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a194b4f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/object-assign-4.0.1.tgz diff --git a/.nodejs010-nodejs-object-assign.metadata b/.nodejs010-nodejs-object-assign.metadata new file mode 100644 index 0000000..dc1d6ff --- /dev/null +++ b/.nodejs010-nodejs-object-assign.metadata @@ -0,0 +1 @@ +99504456c3598b5cad4fc59c26e8a9bb107fe0bd SOURCES/object-assign-4.0.1.tgz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/test.js b/SOURCES/test.js new file mode 100644 index 0000000..81a4c5a --- /dev/null +++ b/SOURCES/test.js @@ -0,0 +1,66 @@ +/* global describe, before, after, it */ + +'use strict'; + +var assert = require('assert'); +var http = require('http'); +var timeout = require('./'); + +it('should do HTTP request with a lot of time', function (done) { + var req = http.get('http://google.com', function (res) { + assert.ok(res.statusCode > 300 && res.statusCode < 399); + done(); + }); + + req.on('error', done); + + timeout(req, 1000); +}); + +it('should emit ETIMEDOUT when time is not enough', function (done) { + var req = http.get('http://google.com', function () {}); + + req.on('error', function (err) { + if (err.code === 'ETIMEDOUT') { + assert.equal(err.message, 'Connection timed out on request to google.com'); + done(); + } + }); + + timeout(req, 1); +}); + +describe('when only headers was sent', function () { + var server; + + before(function (done) { + server = http.createServer(function (request, res) { + setTimeout(function() { + res.writeHead(200, {'content-type':'text/plain'}); + res.write('waited'); + res.end(); + }, 200); + }); + + server.listen(8081, function (err) { + done(err); + }); + }); + + after(function (done) { + server.close(done); + }); + + it('should emit ESOCKETTIMEDOUT', function (done) { + var req = http.get('http://0.0.0.0:8081', function () {}); + + req.on('error', function (err) { + if (err.code === 'ESOCKETTIMEDOUT') { + assert.equal(err.message, 'Socket timed out on request to 0.0.0.0:8081'); + done(); + } + }); + + timeout(req, 400); + }); +}); diff --git a/SPECS/nodejs-object-assign.spec b/SPECS/nodejs-object-assign.spec new file mode 100644 index 0000000..d2a9c7e --- /dev/null +++ b/SPECS/nodejs-object-assign.spec @@ -0,0 +1,72 @@ +%{?scl:%scl_package nodejs-%{module_name}} +%{!?scl:%global pkg_name %{name}} +%{?nodejs_find_provides_and_requires} + +%global enable_tests 0 +%global module_name object-assign + +Name: %{?scl_prefix}nodejs-%{module_name} +Version: 4.0.1 +Release: 5%{?dist} +Summary: ES6 Object.assign() ponyfill +License: MIT +URL: https://github.com/sindresorhus/object-assign +Source0: http://registry.npmjs.org/%{module_name}/-/%{module_name}-%{version}.tgz +Source1: https://raw.githubusercontent.com/sindresorhus/object-assign/master/test.js +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch + +BuildRequires: nodejs010-runtime + +%if 0%{?enable_tests} +BuildRequires: %{?scl_prefix}npm(mocha) +%endif + +%description +%{summary}. + +%prep +%setup -q -n package +rm -rf node_modules + +cp -p %{SOURCE1} . + +%build +# nothing to build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/%{module_name} +cp -pr package.json *.js %{buildroot}%{nodejs_sitelib}/%{module_name} +%nodejs_symlink_deps + +%if 0%{?enable_tests} + +%check +%nodejs_symlink_deps --check +mocha +%endif + +%files +%{!?_licensedir:%global license %doc} +%doc readme.md +%license license +%{nodejs_sitelib}/%{module_name} + +%changelog +* Thu Jan 14 2016 Tomas Hrcka - 4.0.1-5 +- Enable find provides and requires macro + +* Mon Jan 11 2016 Tomas Hrcka - 4.0.1-4 +- Enable scl macros + +* Fri Dec 18 2015 Troy Dawson - 4.0.1-2 +- Update to 4.0.1 + +* Wed Sep 09 2015 Troy Dawson - 2.0.0-3 +- Disable tests until we have all the dependencies + +* Sun Dec 07 2014 Parag Nemade - 2.0.0-2 +- Add test.js from upstream and enable tests + +* Thu Dec 04 2014 Parag Nemade - 2.0.0-1 +- Initial packaging