Skip to content

Commit

Permalink
make sure opts keys are good
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangruber committed Aug 26, 2013
1 parent 40bb33a commit ce61ae0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Screenshot(url, opts) {
this.format('png');

Object.keys(opts || {}).forEach(function (key) {
this[key](opts[key]);
if (typeof this[key] == 'function') this[key](opts[key]);
}.bind(this));
}

Expand Down
4 changes: 3 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ var server = http.createServer(function(req, res) {
width: 1024,
height: 768,
timeout: 100,
format: 'jpeg'
format: 'jpeg',
url: 'trololo'
});
t.equal(s._width, 1024);
t.equal(s._height, 768);
t.equal(s._timeout, 100);
t.equal(s._format, 'JPG');
t.equal(s.url, url);
t.end();
});

Expand Down

0 comments on commit ce61ae0

Please sign in to comment.