Skip to content

Commit

Permalink
test for issue #127
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanong committed Apr 10, 2013
1 parent 134e935 commit 7072740
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/newImage.js
@@ -0,0 +1,30 @@
// https://github.com/aheckmann/gm/issues/127

var assert = require('assert')
var fs = require('fs')

module.exports = function (_, dir, finish, gm) {
if (!gm.integration)
return finish();

createImage().write(dir + '/ignore.me.png', function (err) {
if (err) return finish(err);

createImage().stream(function (err, stdout) {
if (err) return finish(err);

stdout.pipe(fs.createWriteStream(dir + '/ignore.me.2.png'))

stdout.on('error', finish)
stdout.on('end', finish)
})
})

function createImage() {
return gm(70, 30, '#000')
.font("arial", 20)
.stroke("#fff", 2)
.fill("#888")
.drawText(10, 22, 'Some text')
}
}

0 comments on commit 7072740

Please sign in to comment.