diff --git a/.gitignore b/.gitignore index 02e53a9..3916c44 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /pretty-bytes-0.1.0.tgz /pretty-bytes-3.0.1.tgz /test.js +/pretty-bytes-4.0.2.tgz diff --git a/LICENSE b/LICENSE deleted file mode 100644 index c9b44cb..0000000 --- a/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/nodejs-pretty-bytes.spec b/nodejs-pretty-bytes.spec index 3f6bf7d..ebe33da 100644 --- a/nodejs-pretty-bytes.spec +++ b/nodejs-pretty-bytes.spec @@ -4,8 +4,8 @@ %global enable_tests 0 Name: nodejs-pretty-bytes -Version: 3.0.1 -Release: 3%{?dist} +Version: 4.0.2 +Release: 1%{?dist} Summary: Convert bytes to a human readable string License: MIT Group: System Environment/Libraries @@ -71,6 +71,9 @@ ln -sf %{nodejs_sitelib}/pretty-bytes/cli.js \ %changelog +* Fri Sep 22 2017 Jared Smith - 4.0.2-1 +- Update to upstream 4.0.2 release + * Thu Jul 27 2017 Fedora Release Engineering - 3.0.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild diff --git a/sources b/sources index 39292e7..8a14be8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -0e405bb688e82144a6fd6dff9a08e4f8 pretty-bytes-3.0.1.tgz -0287db26081dee55ea41311b165290d8 test.js +SHA512 (pretty-bytes-4.0.2.tgz) = c89005f808db1ca97143c79eccc77fdf83278ff6134378ba90bcef56c1f897f05f205b69e38e27d3055b9ec9fae898a667db81a1fbfcd79691a75cc2a69c655b +SHA512 (test.js) = 9c18f3b3bd29e0de5c13c390f473e94ecdcd86ddd7cbb8ba9b71880e88533f479fa4239975be2df0f86a9ba8a188295fb70a10ab5a2b5c42e228d2aea3992d12 diff --git a/test.js b/test.js index 2b0f0c0..c3d7f03 100644 --- a/test.js +++ b/test.js @@ -1,30 +1,33 @@ import test from 'ava'; -import fn from './'; +import m from './'; test('throws on invalid input', t => { - t.throws(() => fn('')); - t.throws(() => fn('1')); - t.throws(() => fn(NaN)); - t.throws(() => fn(true)); + t.throws(() => m('')); + t.throws(() => m('1')); + t.throws(() => m(NaN)); + t.throws(() => m(true)); + t.throws(() => m(Infinity)); + t.throws(() => m(-Infinity)); + t.throws(() => m(null)); }); test('converts bytes to human readable strings', t => { - t.is(fn(0), '0 B'); - t.is(fn(0.4), '0.4 B'); - t.is(fn(0.7), '0.7 B'); - t.is(fn(10), '10 B'); - t.is(fn(10.1), '10.1 B'); - t.is(fn(999), '999 B'); - t.is(fn(1001), '1 kB'); - t.is(fn(1001), '1 kB'); - t.is(fn(1e16), '10 PB'); - t.is(fn(1e30), '1000000 YB'); + t.is(m(0), '0 B'); + t.is(m(0.4), '0.4 B'); + t.is(m(0.7), '0.7 B'); + t.is(m(10), '10 B'); + t.is(m(10.1), '10.1 B'); + t.is(m(999), '999 B'); + t.is(m(1001), '1 kB'); + t.is(m(1001), '1 kB'); + t.is(m(1e16), '10 PB'); + t.is(m(1e30), '1000000 YB'); }); test('supports negative number', t => { - t.is(fn(-0.4), '-0.4 B'); - t.is(fn(-0.7), '-0.7 B'); - t.is(fn(-10.1), '-10.1 B'); - t.is(fn(-999), '-999 B'); - t.is(fn(-1001), '-1 kB'); + t.is(m(-0.4), '-0.4 B'); + t.is(m(-0.7), '-0.7 B'); + t.is(m(-10.1), '-10.1 B'); + t.is(m(-999), '-999 B'); + t.is(m(-1001), '-1 kB'); });