forked from mapnik/node-mapnik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcairo_surface.test.js
28 lines (22 loc) · 969 Bytes
/
cairo_surface.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"use strict";
var mapnik = require('../');
var assert = require('assert');
describe('mapnik.CairoSurface ', function() {
it('should throw with invalid usage', function() {
// no 'new' keyword
assert.throws(function() { mapnik.CairoSurface(1, 1); });
// invalid args
assert.throws(function() { new mapnik.CairoSurface(); });
assert.throws(function() { new mapnik.CairoSurface(1); });
assert.throws(function() { new mapnik.CairoSurface('foo'); });
assert.throws(function() { new mapnik.CairoSurface('a', 'b', 'c'); });
assert.throws(function() { new mapnik.CairoSurface(1, 'b', 'c'); });
});
it('should be initialized properly', function() {
var im = new mapnik.CairoSurface('SVG',256, 256);
assert.ok(im instanceof mapnik.CairoSurface);
assert.equal(im.width(), 256);
assert.equal(im.height(), 256);
assert.equal(im.getData(), '');
});
});