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

Added configure property. Added configure test #50

Merged
merged 1 commit into from
Jul 17, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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');
});
});