[nodeunit] Initial commit
Jamie Nguyen
jamielinux at fedoraproject.org
Mon Feb 24 16:19:00 UTC 2014
commit 912dd468993e0a9e71f16a5be5cf6bfb25e162c1
Author: Jamie Nguyen <j at jamielinux.com>
Date: Mon Feb 24 16:19:35 2014 +0000
Initial commit
.gitignore | 1 +
nodeunit-0.8.6-Load-system-modules.patch | 136 +++++++++++++++++++++++++++++
nodeunit-0.8.6-Use-system-assert.js.patch | 123 ++++++++++++++++++++++++++
nodeunit.spec | 128 +++++++++++++++++++++++++++
sources | 1 +
5 files changed, 389 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..7dd4173 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/nodeunit-0.8.6.tgz
diff --git a/nodeunit-0.8.6-Load-system-modules.patch b/nodeunit-0.8.6-Load-system-modules.patch
new file mode 100644
index 0000000..fad5b45
--- /dev/null
+++ b/nodeunit-0.8.6-Load-system-modules.patch
@@ -0,0 +1,136 @@
+From b12f1c217b958a826c222de2a08765924636618b Mon Sep 17 00:00:00 2001
+From: Jamie Nguyen <j at jamielinux.com>
+Date: Sun, 23 Feb 2014 15:38:12 +0000
+Subject: [PATCH] Load system modules
+
+---
+ bin/nodeunit | 2 +-
+ examples/browser/nodeunit.js | 4 ++--
+ lib/core.js | 2 +-
+ lib/nodeunit.js | 2 +-
+ lib/reporters/junit.js | 4 ++--
+ lib/types.js | 2 +-
+ lib/utils.js | 2 +-
+ test/test-base.js | 2 +-
+ 8 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/bin/nodeunit b/bin/nodeunit
+index 4b3f4d5..f2c79ba 100755
+--- a/bin/nodeunit
++++ b/bin/nodeunit
+@@ -8,7 +8,7 @@ var
+ // lands in core.
+ //
+ // Until then, use console.log from npm (https://gist.github.com/1077544)
+-require('../deps/console.log');
++require('console.log');
+
+ //require.paths.push(process.cwd());
+ var args = (process.ARGV || process.argv).slice(2);
+diff --git a/examples/browser/nodeunit.js b/examples/browser/nodeunit.js
+index af7fd0b..bca5d1f 100644
+--- a/examples/browser/nodeunit.js
++++ b/examples/browser/nodeunit.js
+@@ -1457,7 +1457,7 @@ assert.ifError = function (err) { if (err) {throw err;}};
+ */
+
+ //var assert = require('./assert'), //@REMOVE_LINE_FOR_BROWSER
+-// async = require('../deps/async'); //@REMOVE_LINE_FOR_BROWSER
++// async = require('async'); //@REMOVE_LINE_FOR_BROWSER
+
+
+ /**
+@@ -1647,7 +1647,7 @@ exports.options = function (opt) {
+ * Module dependencies
+ */
+
+-//var async = require('../deps/async'), //@REMOVE_LINE_FOR_BROWSER
++//var async = require('async'), //@REMOVE_LINE_FOR_BROWSER
+ // types = require('./types'); //@REMOVE_LINE_FOR_BROWSER
+
+
+diff --git a/lib/core.js b/lib/core.js
+index 8ff031b..483a662 100644
+--- a/lib/core.js
++++ b/lib/core.js
+@@ -13,7 +13,7 @@
+ * Module dependencies
+ */
+
+-var async = require('../deps/async'), //@REMOVE_LINE_FOR_BROWSER
++var async = require('async'), //@REMOVE_LINE_FOR_BROWSER
+ nodeunit = require('./nodeunit'), //@REMOVE_LINE_FOR_BROWSER
+ types = require('./types'); //@REMOVE_LINE_FOR_BROWSER
+
+diff --git a/lib/nodeunit.js b/lib/nodeunit.js
+index 7d33c7b..7212ade 100644
+--- a/lib/nodeunit.js
++++ b/lib/nodeunit.js
+@@ -8,7 +8,7 @@
+ * Module dependencies
+ */
+
+-var async = require('../deps/async'),
++var async = require('async'),
+ types = require('./types'),
+ utils = require('./utils'),
+ core = require('./core'),
+diff --git a/lib/reporters/junit.js b/lib/reporters/junit.js
+index 5400526..ac6d545 100644
+--- a/lib/reporters/junit.js
++++ b/lib/reporters/junit.js
+@@ -12,10 +12,10 @@ var nodeunit = require('../nodeunit'),
+ utils = require('../utils'),
+ fs = require('fs'),
+ path = require('path'),
+- async = require('../../deps/async'),
++ async = require('async'),
+ AssertionError = require('assert').AssertionError,
+ child_process = require('child_process'),
+- ejs = require('../../deps/ejs');
++ ejs = require('ejs');
+
+
+ /**
+diff --git a/lib/types.js b/lib/types.js
+index 879edd8..65956f5 100644
+--- a/lib/types.js
++++ b/lib/types.js
+@@ -14,7 +14,7 @@
+ */
+
+ var assert = require('./assert'), //@REMOVE_LINE_FOR_BROWSER
+- async = require('../deps/async'); //@REMOVE_LINE_FOR_BROWSER
++ async = require('async'); //@REMOVE_LINE_FOR_BROWSER
+
+
+ /**
+diff --git a/lib/utils.js b/lib/utils.js
+index 898820f..dc8b736 100644
+--- a/lib/utils.js
++++ b/lib/utils.js
+@@ -8,7 +8,7 @@
+ * Module dependencies
+ */
+
+-var async = require('../deps/async'),
++var async = require('async'),
+ fs = require('fs'),
+ util = require('util'),
+ Script = require('vm').Script,
+diff --git a/test/test-base.js b/test/test-base.js
+index 5335046..b6ff611 100644
+--- a/test/test-base.js
++++ b/test/test-base.js
+@@ -10,7 +10,7 @@
+ */
+
+ var assert = require('assert'), // @REMOVE_LINE_FOR_BROWSER
+- async = require('../deps/async'), // @REMOVE_LINE_FOR_BROWSER
++ async = require('async'), // @REMOVE_LINE_FOR_BROWSER
+ nodeunit = require('../lib/nodeunit'); // @REMOVE_LINE_FOR_BROWSER
+
+
+--
+1.8.5.3
+
diff --git a/nodeunit-0.8.6-Use-system-assert.js.patch b/nodeunit-0.8.6-Use-system-assert.js.patch
new file mode 100644
index 0000000..704fd71
--- /dev/null
+++ b/nodeunit-0.8.6-Use-system-assert.js.patch
@@ -0,0 +1,123 @@
+From 671b19bc318293063a1a636175a3c2b102a4bade Mon Sep 17 00:00:00 2001
+From: Jamie Nguyen <j at jamielinux.com>
+Date: Sun, 23 Feb 2014 15:45:48 +0000
+Subject: [PATCH] Use system assert.js
+
+---
+ lib/nodeunit.js | 2 +-
+ lib/reporters/default.js | 2 +-
+ lib/reporters/eclipse.js | 2 +-
+ lib/reporters/machineout.js | 2 +-
+ lib/reporters/nested.js | 2 +-
+ lib/reporters/verbose.js | 2 +-
+ lib/types.js | 2 +-
+ test/test-bettererrors.js | 2 +-
+ 8 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/lib/nodeunit.js b/lib/nodeunit.js
+index 7212ade..3b5c527 100644
+--- a/lib/nodeunit.js
++++ b/lib/nodeunit.js
+@@ -13,7 +13,7 @@ var async = require('async'),
+ utils = require('./utils'),
+ core = require('./core'),
+ reporters = require('./reporters'),
+- assert = require('./assert'),
++ assert = require('assert'),
+ path = require('path'),
+ events = require('events');
+
+diff --git a/lib/reporters/default.js b/lib/reporters/default.js
+index 0de3f23..3102038 100644
+--- a/lib/reporters/default.js
++++ b/lib/reporters/default.js
+@@ -13,7 +13,7 @@ var nodeunit = require('../nodeunit'),
+ fs = require('fs'),
+ track = require('../track'),
+ path = require('path'),
+- AssertionError = require('../assert').AssertionError;
++ AssertionError = require('assert').AssertionError;
+
+ /**
+ * Reporter info string
+diff --git a/lib/reporters/eclipse.js b/lib/reporters/eclipse.js
+index c56a4b8..1d3a64a 100644
+--- a/lib/reporters/eclipse.js
++++ b/lib/reporters/eclipse.js
+@@ -13,7 +13,7 @@ var nodeunit = require('../nodeunit'),
+ fs = require('fs'),
+ track = require('../track'),
+ path = require('path'),
+- AssertionError = require('../assert').AssertionError;
++ AssertionError = require('assert').AssertionError;
+
+ /**
+ * Reporter info string
+diff --git a/lib/reporters/machineout.js b/lib/reporters/machineout.js
+index c58ee40..c35d451 100644
+--- a/lib/reporters/machineout.js
++++ b/lib/reporters/machineout.js
+@@ -17,7 +17,7 @@ var nodeunit = require('../nodeunit'),
+ fs = require('fs'),
+ track = require('../track'),
+ path = require('path'),
+- AssertionError = require('../assert').AssertionError;
++ AssertionError = require('assert').AssertionError;
+
+ /**
+ * Reporter info string
+diff --git a/lib/reporters/nested.js b/lib/reporters/nested.js
+index 62f3d79..8545614 100644
+--- a/lib/reporters/nested.js
++++ b/lib/reporters/nested.js
+@@ -13,7 +13,7 @@ var nodeunit = require('../nodeunit'),
+ fs = require('fs'),
+ track = require('../track'),
+ path = require('path'),
+- AssertionError = require('../assert').AssertionError;
++ AssertionError = require('assert').AssertionError;
+
+ /**
+ * Reporter info string
+diff --git a/lib/reporters/verbose.js b/lib/reporters/verbose.js
+index 6c6083a..1d7e849 100644
+--- a/lib/reporters/verbose.js
++++ b/lib/reporters/verbose.js
+@@ -13,7 +13,7 @@ var nodeunit = require('../nodeunit'),
+ fs = require('fs'),
+ track = require('../track'),
+ path = require('path');
+- AssertionError = require('../assert').AssertionError;
++ AssertionError = require('assert').AssertionError;
+
+ /**
+ * Reporter info string
+diff --git a/lib/types.js b/lib/types.js
+index 65956f5..1b3b181 100644
+--- a/lib/types.js
++++ b/lib/types.js
+@@ -13,7 +13,7 @@
+ * Module dependencies
+ */
+
+-var assert = require('./assert'), //@REMOVE_LINE_FOR_BROWSER
++var assert = require('assert'), //@REMOVE_LINE_FOR_BROWSER
+ async = require('async'); //@REMOVE_LINE_FOR_BROWSER
+
+
+diff --git a/test/test-bettererrors.js b/test/test-bettererrors.js
+index 4cae570..e924d1a 100644
+--- a/test/test-bettererrors.js
++++ b/test/test-bettererrors.js
+@@ -2,7 +2,7 @@
+ * Test utils.betterErrors. utils.betterErrors should provide sensible error messages even when the error does not
+ * contain expected, actual or operator.
+ */
+-var assert = require("../lib/assert");
++var assert = require("assert");
+ var should = require("should");
+ var types = require("../lib/types");
+ var util = require('util');
+--
+1.8.5.3
+
diff --git a/nodeunit.spec b/nodeunit.spec
new file mode 100644
index 0000000..0be100b
--- /dev/null
+++ b/nodeunit.spec
@@ -0,0 +1,128 @@
+%{?nodejs_find_provides_and_requires}
+
+%global enable_tests 1
+
+Name: nodeunit
+Version: 0.8.6
+Release: 1%{?dist}
+Summary: Easy asynchronous unit testing framework for Node.js
+License: MIT
+Group: System Environment/Libraries
+URL: https://github.com/caolan/nodeunit
+Source0: http://registry.npmjs.org/nodeunit/-/nodeunit-%{version}.tgz
+Patch0: %{name}-0.8.6-Load-system-modules.patch
+Patch1: %{name}-0.8.6-Use-system-assert.js.patch
+
+BuildArch: noarch
+%if 0%{?fedora} >= 19
+ExclusiveArch: %{nodejs_arches} noarch
+%else
+ExclusiveArch: %{ix86} x86_64 %{arm} noarch
+%endif
+
+BuildRequires: nodejs-packaging
+
+%if 0%{?enable_tests}
+BuildRequires: coffee-script
+BuildRequires: expresso
+BuildRequires: npm(async)
+BuildRequires: npm(console.log)
+BuildRequires: npm(ejs)
+BuildRequires: npm(paperboy)
+BuildRequires: npm(should)
+BuildRequires: npm(tap)
+%endif
+
+%description
+Nodeunit provides an easy asynchronous unit testing framework for Node.js:
+ - helps you avoid common pitfalls when testing asynchronous code
+ - easy to add test cases with setUp and tearDown functions if you wish
+ - flexible reporters for custom output
+ - built-in support for HTML and jUnit XML
+ - allows the use of mocks and stubs
+
+
+%prep
+%setup -q -n package
+# Remove bundled dependencies
+rm -rf deps/
+rm -f lib/assert.js
+# The requires need to be amended to use the unbundled dependencies.
+%patch0 -p1
+%patch1 -p1
+
+%nodejs_fixdep async '~0.2'
+%nodejs_fixdep console.log '~0.1'
+%nodejs_fixdep ejs '~0.8'
+
+
+%build
+#nothing to do
+
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/nodeunit
+cp -pr package.json index.js lib/ \
+ %{buildroot}%{nodejs_sitelib}/nodeunit
+mkdir -p %{buildroot}%{_bindir}
+ln -sf %{nodejs_sitelib}/nodeunit/bin/nodeunit \
+ %{buildroot}%{_bindir}/nodeunit
+
+install -p -D -m0644 man1/nodeunit.1 \
+ %{buildroot}%{_mandir}/man1/nodeunit.1
+
+# Put non-javascript arch independent files in _datadir to comply with Node.js
+# packaging guidelines.
+mkdir -p %{buildroot}%{_datadir}/nodeunit/bin
+install -p -D -m0644 bin/nodeunit.json \
+ %{buildroot}%{_datadir}/nodeunit/bin/nodeunit.json
+cp -pr share/ %{buildroot}%{_datadir}/nodeunit
+mkdir -p %{buildroot}%{nodejs_sitelib}/nodeunit/bin
+ln -sf %{_datadir}/nodeunit/bin/nodeunit.json \
+ %{buildroot}%{nodejs_sitelib}/nodeunit/bin/nodeunit.json
+ln -sf %{_datadir}/nodeunit/share \
+ %{buildroot}%{nodejs_sitelib}/nodeunit/share
+
+
+%nodejs_symlink_deps
+
+
+%if 0%{?enable_tests}
+%check
+%nodejs_symlink_deps --check
+%__nodejs ./bin/nodeunit test --reporter tap
+%endif
+
+
+%files
+%doc CONTRIBUTORS.md LICENSE README.md doc/ examples/
+%{nodejs_sitelib}/nodeunit
+%{_bindir}/nodeunit
+%{_datadir}/nodeunit
+%{_mandir}/man1/nodeunit.1*
+
+
+%changelog
+* Sun Feb 23 2014 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.8.6-1
+- update to upstream release 0.8.6
+- remove lib/assert.js
+
+* Sun Feb 23 2014 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.8.1-3
+- fix summary and description
+- use patch instead of sed
+
+* Sun Feb 23 2014 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.8.1-2
+- remove nodejs-json2 dependency as it is not needed either for runtime or
+ for the unit tests
+
+* Wed Aug 28 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.8.1-1
+- update to upstream release 0.8.1
+- remove patch that has been upstreamed
+- put non-javascript arch independent files in _datadir to comply with Node.js
+ packaging guidelines
+
+* Wed May 29 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.8.0-1
+- update to upstream release 0.8.0
+
+* Sun Feb 17 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.7.4-1
+- initial package
diff --git a/sources b/sources
index e69de29..3b29d45 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+c117782f6b4d9c45970f75367a86699b nodeunit-0.8.6.tgz
More information about the scm-commits
mailing list