Skip to content
Browse files

added test to see if the qrencode lib is even installed right

  • Loading branch information...
1 parent a31e7bc commit 6b64a4e4da2ca128595f731c144897ede480de83 @bcelenza bcelenza committed
Showing with 14 additions and 1 deletion.
  1. +3 −1 lib/encoder.js
  2. +11 −0 test/encoder.js
View
4 lib/encoder.js
@@ -43,7 +43,9 @@ Encoder.prototype.encode = function(value, path, options)
var cmd_options = {};
if(options == null) options = {};
for(var key in this.default_options) {
- cmd_options[key] = (options[key] == undefined) ? this.default_options[key] : options[key];
+ cmd_options[key] = (options[key] == undefined) ?
+ this.default_options[key]
+ : options[key];
}
// start with base set of args that we'll always pass
View
11 test/encoder.js
@@ -3,12 +3,23 @@ var vows = require('vows'),
assert = require('assert'),
fs = require('fs'),
util = require('util'),
+ child_process = require('child_process'),
qr = require('../qr');
var Encoder = qr.Encoder;
var test_file_name = './test.png';
vows.describe('Encoder').addBatch({
+ 'The libqrencode library': {
+ topic: function() {
+ var which = child_process.spawn('which', ['qrencode']);
+ which.on('exit', this.callback);
+ },
+ 'is installed and available via $PATH': function(exit_code, process) {
+ assert.equal(exit_code, null, 'libqrencode does not appear to have been installed properly');
+ }
+ }
+}).addBatch({
'The encoder': {
topic: new(Encoder),
'is an event emitter': function(encoder) {

0 comments on commit 6b64a4e

Please sign in to comment.
Something went wrong with that request. Please try again.