diff --git a/0001-fix-tests-for-Node.js-6.5.patch b/0001-fix-tests-for-Node.js-6.5.patch new file mode 100644 index 0000000..4f675c1 --- /dev/null +++ b/0001-fix-tests-for-Node.js-6.5.patch @@ -0,0 +1,31 @@ +From a3fb1652d76e4a19772f4b02eb3c11067fa7167e Mon Sep 17 00:00:00 2001 +From: Sergey Burmisov +Date: Thu, 29 Sep 2016 19:10:16 +0300 +Subject: [PATCH] fix tests for Node.js 6.5+ + +Signed-off-by: Stephen Gallagher +--- + test/user_defined_type.js | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/test/user_defined_type.js b/test/user_defined_type.js +index db85fc5c0f40fabff2d7750e2e3c76270339b6c2..053213a880f36d0f4ad2729709253e80bb5da37b 100644 +--- a/test/user_defined_type.js ++++ b/test/user_defined_type.js +@@ -110,11 +110,12 @@ describe('user defined type', function () { + parser.addArgument([ '-d' ], { type: dateType }); + args = parser.parseArgs([ '-d', '1/1/2012' ]); + assert.deepEqual(args, { d: new Date('1/1/2012') }); + assert.throws( + function () { parser.parseArgs([ '-d', 'abc' ]); }, +- /Invalid value: abc\nabc is not a valid date/im ++ TypeError, ++ /Invalid .+ value: abc/im + ); + }); + }); + // could test for: Error: "dateType" is not callable + // by using an unregistered string or other nonfunction +-- +2.9.3 + diff --git a/nodejs-argparse.spec b/nodejs-argparse.spec index c9b9f1d..a1b2d16 100644 --- a/nodejs-argparse.spec +++ b/nodejs-argparse.spec @@ -4,7 +4,7 @@ Name: nodejs-argparse Version: 1.0.7 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A native port of Python's argparse, an options parsing library License: MIT Group: System Environment/Libraries @@ -32,6 +32,8 @@ BuildRequires: npm(underscore.string) BuildRequires: npm(sprintf-js) %endif +Patch0001: 0001-fix-tests-for-Node.js-6.5.patch + %description This is a native port of Python's argparse, an options parsing library. It's a full port, except some very rare options. Method names have been @@ -41,6 +43,7 @@ changed to CamelCase. %prep %setup -q -n package %setup -q -D -T -a 1 -n package +%patch0001 -p1 %nodejs_fixdep underscore '~1.4' @@ -73,6 +76,9 @@ cp -pr package.json *.js lib/ \ %changelog +* Mon Dec 05 2016 Stephen Gallagher - 1.0.7-2 +- Fix tests for building with Node.js 6.5+ + * Thu Jul 28 2016 Tom Hughes - 1.0.7-1 - Update to 1.0.7 upstream release - Enable tests