diff --git a/has-color-0.1.7.tgz b/has-color-0.1.7.tgz deleted file mode 100644 index adf244f..0000000 Binary files a/has-color-0.1.7.tgz and /dev/null differ diff --git a/nodejs-has-color-0.1.7.tar.gz b/nodejs-has-color-0.1.7.tar.gz new file mode 100644 index 0000000..a5ac91a Binary files /dev/null and b/nodejs-has-color-0.1.7.tar.gz differ diff --git a/nodejs-has-color.spec b/nodejs-has-color.spec index 69714ae..16e8c33 100644 --- a/nodejs-has-color.spec +++ b/nodejs-has-color.spec @@ -1,15 +1,17 @@ %{?nodejs_find_provides_and_requires} %global enable_tests 1 +%global packagename supports-color + Name: nodejs-has-color Version: 0.1.7 Release: 1 Summary: Detects whether a terminal supports color License: MIT -URL: https://github.com/sindresorhus/has-color -Source0: http://registry.npmjs.org/has-color/-/has-color-%{version}.tgz -Source1: https://raw.githubusercontent.com/sindresorhus/has-color/ab671b1f74846d9fb9caea8dc302603a865be3cc/test.js +URL: https://github.com/chalk/supports-color +#https://codeload.github.com/chalk/supports-color/tar.gz/v0.1.7 +Source0: %{name}-%{version}.tar.gz #https://opensource.org.licenses/MIT -Source2: LICENSE +Source1: LICENSE BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging @@ -20,9 +22,8 @@ BuildRequires: npm(mocha) %{summary}. %prep -%setup -q -n package +%setup -q -n %{packagename}-%{version} cp -p %{SOURCE1} . -cp -p %{SOURCE2} . %build diff --git a/test.js b/test.js deleted file mode 100644 index 752fc15..0000000 --- a/test.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; -var assert = require('assert'); - -beforeEach(function () { - // clear the cache of the tested module - delete require.cache[require.resolve('./index')]; - process.stdout.isTTY = true; - process.argv = []; - process.env = {}; -}); - -it('should return false if not TTY', function () { - process.stdout.isTTY = false; - assert.equal(require('./index'), false); -}); - -it('should return false if --no-color flag is used', function () { - process.argv = ['--no-color']; - assert.equal(require('./index'), false); -}); - -it('should return true if --color flag is used', function () { - process.argv = ['--color']; - assert.equal(require('./index'), true); -}); - -it('should return true if `COLORTERM` is in env', function () { - process.env.COLORTERM = true; - assert.equal(require('./index'), true); -});