[mocha] Initial import
Jamie Nguyen
jamielinux at fedoraproject.org
Wed Mar 20 21:14:06 UTC 2013
commit 39de85b0c6ffba198a5f898880295168ba7ae7c6
Author: Jamie Nguyen <j at jamielinux.com>
Date: Wed Mar 20 21:13:58 2013 +0000
Initial import
.gitignore | 2 +
dl-tests.sh | 23 ++++++
mocha.1 | 91 ++++++++++++++++++++++++
mocha.spec | 138 +++++++++++++++++++++++++++++++++++++
nodejs-mocha-1.8.1-node-dep.patch | 12 +++
sources | 2 +
6 files changed, 268 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..e7219e5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/mocha-1.8.2.tgz
+/tests-1.8.1.tar.bz2
diff --git a/dl-tests.sh b/dl-tests.sh
new file mode 100755
index 0000000..05be1fe
--- /dev/null
+++ b/dl-tests.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+tag=1.8.1
+
+set -e
+
+tmp=$(mktemp -d)
+
+trap cleanup EXIT
+cleanup() {
+ set +e
+ [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
+}
+
+unset CDPATH
+pwd=$(pwd)
+
+pushd "$tmp"
+git clone git://github.com/visionmedia/mocha.git
+cd mocha
+git archive --prefix="test/" --format=tar tags/${tag}:test/ \
+ | bzip2 > "$pwd"/tests-${tag}.tar.bz2
+popd
diff --git a/mocha.1 b/mocha.1
new file mode 100644
index 0000000..f699ad2
--- /dev/null
+++ b/mocha.1
@@ -0,0 +1,91 @@
+.TH MOCHA "1" "March 2013" "mocha 1.8.2" "User Commands"
+.SH NAME
+mocha \- A feature-rich JavaScript test framework for Node.js
+.SH SYNOPSIS
+Usage: mocha [debug] [options] [files]
+.SH DESCRIPTION
+Mocha is a feature-rich JavaScript test framework running on node and the
+browser, making asynchronous testing simple and fun. Mocha tests run serially,
+allowing for flexible and accurate reporting, while mapping uncaught
+exceptions to the correct test cases.
+.SH COMMANDS
+.TP
+init <path>
+initialize a client\-side mocha setup at <path>
+.SH OPTIONS
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+output usage information
+.TP
+\fB\-V\fR, \fB\-\-version\fR
+output the version number
+.TP
+\fB\-r\fR, \fB\-\-require\fR <name>
+require the given module
+.TP
+\fB\-R\fR, \fB\-\-reporter\fR <name>
+specify the reporter to use
+.TP
+\fB\-u\fR, \fB\-\-ui\fR <name>
+specify user\-interface (bdd|tdd|exports)
+.TP
+\fB\-g\fR, \fB\-\-grep\fR <pattern>
+only run tests matching <pattern>
+.TP
+\fB\-i\fR, \fB\-\-invert\fR
+inverts \fB\-\-grep\fR matches
+.TP
+\fB\-t\fR, \fB\-\-timeout\fR <ms>
+set test\-case timeout in milliseconds [2000]
+.TP
+\fB\-s\fR, \fB\-\-slow\fR <ms>
+"slow" test threshold in milliseconds [75]
+.TP
+\fB\-w\fR, \fB\-\-watch\fR
+watch files for changes
+.TP
+\fB\-c\fR, \fB\-\-colors\fR
+force enabling of colors
+.TP
+\fB\-C\fR, \fB\-\-no\-colors\fR
+force disabling of colors
+.TP
+\fB\-G\fR, \fB\-\-growl\fR
+enable growl notification support
+.TP
+\fB\-d\fR, \fB\-\-debug\fR
+enable node's debugger, synonym for node \fB\-\-debug\fR
+.TP
+\fB\-b\fR, \fB\-\-bail\fR
+bail after first test failure
+.TP
+\fB\-A\fR, \fB\-\-async\-only\fR
+force all tests to take a callback (async)
+.TP
+\fB\-\-recursive\fR
+include sub directories
+.TP
+\fB\-\-debug\-brk\fR
+enable node's debugger breaking on the first line
+.TP
+\fB\-\-globals\fR <names>
+allow the given comma\-delimited global [names]
+.TP
+\fB\-\-ignore\-leaks\fR
+ignore global variable leaks
+.TP
+\fB\-\-interfaces\fR
+display available interfaces
+.TP
+\fB\-\-reporters\fR
+display available reporters
+.TP
+\fB\-\-compilers\fR <ext>:<module>,...
+use the given module(s) to compile files
+.SH AUTHORS
+The main author of mocha is TJ Holowaychuk <\fBtj at vision-media.ca\fR>.
+For a more complete list of contributors, see the GitHub page at
+<\fBhttps://github.com/visionmedia/mocha\fR>
+.SH REPORTING BUGS
+Please report bugs on the GitHub issue tracker:
+<\fBhttps://github.com/visionmedia/mocha/issues\fR>
diff --git a/mocha.spec b/mocha.spec
new file mode 100644
index 0000000..5277097
--- /dev/null
+++ b/mocha.spec
@@ -0,0 +1,138 @@
+%global enable_tests 0
+
+Name: mocha
+Version: 1.8.2
+Release: 3%{?dist}
+Summary: A simple, flexible, fun test framework for Node.js
+License: MIT
+Group: System Environment/Libraries
+URL: https://github.com/visionmedia/mocha
+Source0: http://registry.npmjs.org/mocha/-/mocha-%{version}.tgz
+# The test files are not included in the npm tarball.
+# Source1 is generated by running Source10, which pulls from the upstream
+# version control repository.
+Source1: tests-1.8.1.tar.bz2
+# This is a custom manual page for mocha. Pull request sent upstream:
+# https://github.com/visionmedia/mocha/pull/758
+Source2: mocha.1
+Source10: dl-tests.sh
+BuildArch: noarch
+
+# Dep generator bug which adds a trailing dot in the node(engine) requires.
+Patch0: nodejs-mocha-1.8.1-node-dep.patch
+
+BuildRequires: nodejs-devel
+
+%if 0%{?enable_tests}
+BuildRequires: npm(commander)
+BuildRequires: npm(debug)
+BuildRequires: npm(diff)
+BuildRequires: npm(growl)
+BuildRequires: npm(jade)
+BuildRequires: npm(mkdirp)
+BuildRequires: npm(ms)
+BuildRequires: npm(should)
+%endif
+
+%description
+Mocha is a feature-rich JavaScript test framework running on Node.js and the
+browser, making asynchronous testing simple and fun. Mocha tests run serially,
+allowing for flexible and accurate reporting, while mapping uncaught
+exceptions to the correct test cases.
+
+
+%prep
+%setup -q -n package
+%setup -T -D -a 1 -q -n package
+%patch0 -p1
+%nodejs_fixdep commander '~1.0'
+%nodejs_fixdep jade '~0.26'
+%nodejs_fixdep diff '1.0.x'
+%nodejs_fixdep mkdirp '~0.3'
+%nodejs_fixdep ms '~0.3'
+# Remove bundled diff.js
+rm -f lib/browser/diff.js
+
+
+%build
+#nothing to do
+
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/mocha
+cp -pr package.json index.js lib/ mocha.css _mocha.js mocha.js \
+ %{buildroot}%{nodejs_sitelib}/mocha
+
+rm -f %{buildroot}%{nodejs_sitelib}/mocha/lib/template.html
+rm -rf %{buildroot}%{nodejs_sitelib}/mocha/lib/reporters/templates
+
+mkdir -p %{buildroot}%{nodejs_sitelib}/mocha/bin
+install -p -D -m0755 bin/mocha %{buildroot}%{nodejs_sitelib}/mocha/bin/mocha
+install -p -D -m0755 bin/_mocha %{buildroot}%{nodejs_sitelib}/mocha/bin/_mocha
+mkdir -p %{buildroot}%{_bindir}
+ln -sf %{nodejs_sitelib}/mocha/bin/mocha %{buildroot}%{_bindir}/mocha
+
+# Install the custom manual page.
+mkdir -p %{buildroot}%{_mandir}/man1
+install -p -D -m0644 %{SOURCE2} %{buildroot}%{_mandir}/man1/mocha.1
+
+# Use system diff.js instead.
+ln -sf %{nodejs_sitelib}/diff/diff.js \
+ %{buildroot}%{nodejs_sitelib}/mocha/lib/browser/diff.js
+
+# Put these files in _datadir to comply with packaging guidelines.
+mkdir -p %{buildroot}%{_datadir}/mocha/images
+cp -pr images/*.png \
+ %{buildroot}%{_datadir}/mocha/images
+ln -sf %{_datadir}/mocha/images \
+ %{buildroot}%{nodejs_sitelib}/mocha/images
+cp -pr lib/template.html \
+ %{buildroot}%{_datadir}/mocha
+ln -sf %{_datadir}/mocha/template.html \
+ %{buildroot}%{nodejs_sitelib}/mocha/lib/template.html
+cp -pr lib/reporters/templates \
+ %{buildroot}%{_datadir}/mocha
+ln -sf %{_datadir}/mocha/templates \
+ %{buildroot}%{nodejs_sitelib}/mocha/lib/reporters/templates
+
+%nodejs_symlink_deps
+
+
+%if 0%{?enable_tests}
+%check
+cp -pr %{nodejs_sitelib} .
+./bin/mocha --reporter dot test/acceptance/*.js test/*.js
+%endif
+
+
+%files
+%doc History.md LICENSE Readme.md
+%{nodejs_sitelib}/mocha
+%{_bindir}/mocha
+%{_datadir}/mocha
+%{_mandir}/man1/mocha.1*
+
+
+%changelog
+* Tue Mar 19 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 1.8.2-3
+- fix incorrect %%changelog entries
+
+* Tue Mar 19 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 1.8.2-2
+- fix symlinks
+
+* Tue Mar 19 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 1.8.2-1
+- update to upstream release 1.8.2
+- move images and templates to %%{_datadir} to comply with packaging
+ guidelines
+
+* Sat Mar 02 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 1.8.1-3
+- add a custom man page
+- include /usr/lib/node_modules/mocha/images/
+- remove bundled diff.js and use system diff.js instead
+- remove /usr/bin/_mocha symlink
+
+* Thu Feb 14 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 1.8.1-2
+- rename from nodejs-mocha to just mocha
+
+* Thu Feb 14 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 1.8.1-1
+- initial package
diff --git a/nodejs-mocha-1.8.1-node-dep.patch b/nodejs-mocha-1.8.1-node-dep.patch
new file mode 100644
index 0000000..ea5be98
--- /dev/null
+++ b/nodejs-mocha-1.8.1-node-dep.patch
@@ -0,0 +1,12 @@
+diff -Naur a/package.json b/package.json
+--- a/package.json
++++ b/package.json
+@@ -20,7 +20,7 @@
+ "_mocha": "./bin/_mocha"
+ },
+ "engines": {
+- "node": ">= 0.4.x"
++ "node": ">= 0.4.0"
+ },
+ "scripts": {
+ "test": "make test-all"
diff --git a/sources b/sources
index e69de29..a245f4e 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+e71777c6ff004f74b1528fa931f8ed4e mocha-1.8.2.tgz
+6fd71e31003ca3bfa7ea0b20b3955f83 tests-1.8.1.tar.bz2
More information about the scm-commits
mailing list