Blob Blame History Raw
#disable tests since nodejs-bunker isn't in the distro yet
#%%global enable_tests 1

Name:           nodejs-runforcover
Version:        0.0.2
Release:        2%{?dist}
Summary:        Require plugin for JS code coverage
BuildArch:      noarch

Group:          System Environment/Libraries
#no license file included; "new BSD" indicated in package.json
License:        BSD
URL:            https://github.com/chrisdickinson/node-runforcover
Source0:        http://registry.npmjs.org/runforcover/-/runforcover-%{version}.tgz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  nodejs-devel

%if 0%{?enable_tests}
BuildRequires:  npm(bunker)
%endif

%description
Runforcover hooks into the `require()` function and uses nodejs-bunker to
provide code coverage data for your unit test library, whatever it might be.

%prep
%setup -q -n package

%build
#nothing to do

%install
rm -rf %buildroot

mkdir -p %{buildroot}%{nodejs_sitelib}/runforcover
cp -pr package.json index.js %{buildroot}%{nodejs_sitelib}/runforcover

%nodejs_symlink_deps

%if 0%{?enable_tests}
%check
mkdir -p node_modules
ln -sf %{nodejs_sitelib}/bunker node_modules/bunker
%__nodejs test/index.js
%endif

%clean
rm -rf %buildroot

%files
%defattr(-,root,root,-)
%{nodejs_sitelib}/runforcover
%doc README.markdown

%changelog
* Wed Feb 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.0.2-2
- fix and conditionalize tests

* Tue Jan 08 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.0.2-1
- initial package generated by npm2rpm