mirror of https://gitgud.io/fatchan/gm
parent
1ed586d0bc
commit
a2dccd2660
2 changed files with 48 additions and 1 deletions
@ -0,0 +1,33 @@ |
|||||||
|
|
||||||
|
var assert = require('assert') |
||||||
|
|
||||||
|
module.exports = function (img, dir, finish, gm) { |
||||||
|
|
||||||
|
assert.equal(undefined, gm.prototype._options.timeout); |
||||||
|
assert.equal(undefined, img._options.timeout); |
||||||
|
|
||||||
|
var g = gm('test').options({ timeout: 100 }); |
||||||
|
assert.equal(100, g._options.timeout); |
||||||
|
|
||||||
|
var sub = gm.subClass({ timeout: 2000 }); |
||||||
|
assert.equal(2000, sub.prototype._options.timeout); |
||||||
|
|
||||||
|
|
||||||
|
if (!gm.integration) |
||||||
|
return finish(); |
||||||
|
|
||||||
|
gm(dir + '/photo.JPG').options({ timeout: 1 }) |
||||||
|
.thumb(50, 80, dir + '/timeout.png', function subthumb (err) { |
||||||
|
assert.ok(err, "Expecting a timeout error"); |
||||||
|
noTimeout(); |
||||||
|
}); |
||||||
|
|
||||||
|
|
||||||
|
function noTimeout() { |
||||||
|
gm(dir + '/photo.JPG').options({ timeout: 0 }) |
||||||
|
.thumb(50, 80, dir + '/timeout.png', function subthumb (err) { |
||||||
|
finish(err); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue