Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

Commit

Permalink
Added configure property. Added configure test
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Throener authored and Andrew Throener committed Jul 9, 2014
1 parent faaaed4 commit cc0d2fc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/paypal-rest-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ module.exports = function () {
}

function configure(options) {
default_options = merge(default_options, options);
if (options !== undefined && typeof options === 'object') {
default_options = merge(default_options, options);
}
}

function generate_token(config, cb) {
Expand Down Expand Up @@ -338,6 +340,7 @@ module.exports = function () {
configure: function (options) {
configure(options);
},
configuration: default_options,
generate_token: function (config, cb) {
generate_token(config, cb);
},
Expand Down
15 changes: 15 additions & 0 deletions test/configure-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"use strict";

var chai = require('chai'),
expect = chai.expect,
should = chai.should();

var paypal_sdk = require('../');
require('./configure');

describe('Configure Test', function () {
it ('Should return default options', function () {
var config = paypal_sdk.configuration;
config.should.be.a('object');
});
});

0 comments on commit cc0d2fc

Please sign in to comment.