[Pkg-javascript-commits] [node-mime-types] 16/19: move changes for test to another patch

Leo Iannacone l3on-guest at moszumanska.debian.org
Fri Oct 10 10:12:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

l3on-guest pushed a commit to branch master
in repository node-mime-types.

commit ff27e1a2886bfd78df0580c015a6fc27f3ca9d4c
Author: Leo Iannacone <l3on at ubuntu.com>
Date:   Fri Oct 10 11:55:22 2014 +0200

    move changes for test to another patch
---
 debian/patches/0001-use-system-mime-types.patch    | 53 +++++---------------
 .../patches/0002-update-tests-with-new-mimes.patch | 57 ++++++++++++++++++++++
 2 files changed, 69 insertions(+), 41 deletions(-)

diff --git a/debian/patches/0001-use-system-mime-types.patch b/debian/patches/0001-use-system-mime-types.patch
index 68685dd..428881b 100644
--- a/debian/patches/0001-use-system-mime-types.patch
+++ b/debian/patches/0001-use-system-mime-types.patch
@@ -1,6 +1,5 @@
 Description: use system's mime-types instead of taking
  them from Internet.
- Update tests according with new mime types database.
  Update README according with these changes.
 Author: Leo Iannacone <l3on at ubuntu.com>
 Forwarded: not-needed
@@ -9,15 +8,15 @@ Forwarded: not-needed
  node_modules/mime-db/README.md             |    4 +--
  node_modules/mime-db/scripts/build.js      |   31 -----------------------------
  node_modules/mime-db/scripts/extensions.js |   20 +++---------------
- node_modules/mime-db/test/index.js         |   13 +++---------
- 4 files changed, 11 insertions(+), 57 deletions(-)
+ node_modules/mime-db/test/index.js         |   11 ++--------
+ 4 files changed, 10 insertions(+), 56 deletions(-)
 
 --- a/node_modules/mime-db/scripts/build.js
 +++ b/node_modules/mime-db/scripts/build.js
 @@ -1,41 +1,12 @@
- 
+
  var db = {}
- 
+
 -// initialize with all the IANA types
 -require('../src/iana.json').forEach(function (mime) {
 -  // i don't think the name is useful,
@@ -56,59 +55,31 @@ Forwarded: not-needed
 +  var o = db[t] = db[t] || {source: 'mime-support'}
    if (e.length) o.extensions = (o.extensions || []).concat(e)
  })
- 
---- a/node_modules/mime-db/test/index.js
-+++ b/node_modules/mime-db/test/index.js
-@@ -21,13 +21,8 @@
-     assert.equal('UTF-8', db['application/javascript'].charset)
-   })
- 
--  it('should set audio/x-flac with extension=flac', function () {
--    assert.equal('flac', db['audio/x-flac'].extensions[0])
--  })
--
--  it('should have guessed application/mathml+xml', function () {
--    // because it doesn't have a "template"
--    assert(db['application/mathml+xml'])
-+  it('should set audio/flac with extension=flac', function () {
-+    assert.equal('flac', db['audio/flac'].extensions[0])
-   })
- 
-   it('should not have an empty .extensions', function () {
-@@ -39,7 +34,7 @@
-   })
- 
-   it('should have the default .extension as the first', function () {
--assert.equal(db['text/plain'].extensions[0], 'txt')
--assert.equal(db['video/x-matroska'].extensions[0], 'mkv')
-+assert.equal(db['text/plain'].extensions[0], 'asc')
-+assert.equal(db['video/x-matroska'].extensions[0], 'mpv')
-   })
- })
+
 --- a/node_modules/mime-db/README.md
 +++ b/node_modules/mime-db/README.md
 @@ -11,8 +11,8 @@
  allowing it to remain as unopinionated as possible with an API.
  It aggregates data from the following sources:
- 
+
 -- http://www.iana.org/assignments/media-types/media-types.xhtml
 -- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
 + * /etc/mime.types
 + * /usr/share/node-mime/node.types
- 
+
  ## Usage
- 
+
 --- a/node_modules/mime-db/scripts/extensions.js
 +++ b/node_modules/mime-db/scripts/extensions.js
 @@ -3,27 +3,15 @@
   * Convert these text files to JSON for browser usage.
   */
- 
+
 -var co = require('co')
  var fs = require('fs')
  var path = require('path')
 -var cogent = require('cogent')
- 
+
 -co(function* () {
 -  yield [
 -    get('http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types'),
@@ -117,13 +88,13 @@ Forwarded: not-needed
 -})()
 +get('/etc/mime.types');
 +get('/usr/share/node-mime/node.types');
- 
+
 -function* get(url) {
 -  var res = yield* cogent(url, {
 -    string: true
 -  })
 +function get(url) {
- 
+
 -  if (res.statusCode !== 200)
 -    throw new Error('got status code ' + res.statusCode + ' from ' + url)
 -
diff --git a/debian/patches/0002-update-tests-with-new-mimes.patch b/debian/patches/0002-update-tests-with-new-mimes.patch
new file mode 100644
index 0000000..326cd9a
--- /dev/null
+++ b/debian/patches/0002-update-tests-with-new-mimes.patch
@@ -0,0 +1,57 @@
+Description: Update tests according with system mime types.
+Author: Leo Iannacone <l3on at ubuntu.com>
+Forwarded: not-needed
+
+---
+ node_modules/mime-db/test/index.js |   13 ++++---------
+ test/mime.js                       |    4 ++--
+ 2 files changed, 6 insertions(+), 11 deletions(-)
+
+--- a/node_modules/mime-db/test/index.js
++++ b/node_modules/mime-db/test/index.js
+@@ -21,13 +21,8 @@
+     assert.equal('UTF-8', db['application/javascript'].charset)
+   })
+ 
+-  it('should set audio/x-flac with extension=flac', function () {
+-    assert.equal('flac', db['audio/x-flac'].extensions[0])
+-  })
+-
+-  it('should have guessed application/mathml+xml', function () {
+-    // because it doesn't have a "template"
+-    assert(db['application/mathml+xml'])
++  it('should set audio/flac with extension=flac', function () {
++    assert.equal('flac', db['audio/flac'].extensions[0])
+   })
+ 
+   it('should not have an empty .extensions', function () {
+@@ -39,7 +34,7 @@
+   })
+ 
+   it('should have the default .extension as the first', function () {
+-assert.equal(db['text/plain'].extensions[0], 'txt')
+-assert.equal(db['video/x-matroska'].extensions[0], 'mkv')
++assert.equal(db['text/plain'].extensions[0], 'asc')
++assert.equal(db['video/x-matroska'].extensions[0], 'mpv')
+   })
+ })
+--- a/test/mime.js
++++ b/test/mime.js
+@@ -33,7 +33,7 @@
+ // Test extensions
+ //
+ 
+-eq('txt', mime.extension(mime.types.text));
++eq('asc', mime.extension(mime.types.text));
+ eq('html', mime.extension(mime.types.htm));
+ eq('bin', mime.extension('application/octet-stream'));
+ eq('bin', mime.extension('application/octet-stream '));
+@@ -51,7 +51,7 @@
+ 
+ eq('application/font-woff', mime.lookup('file.woff'));
+ eq('application/octet-stream', mime.lookup('file.buffer'));
+-eq('audio/mp4', mime.lookup('file.m4a'));
++eq('audio/mpeg', mime.lookup('file.m4a'));
+ eq('font/opentype', mime.lookup('file.otf'));
+ 
+ //

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-mime-types.git



More information about the Pkg-javascript-commits mailing list