From b23d0bc7c9fec0ca7b064b41c23c6f1d5466d581 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Thu, 12 Feb 2015 10:39:27 -0300 Subject: [PATCH 1/2] add doc version test --- test/docs.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/docs.js diff --git a/test/docs.js b/test/docs.js new file mode 100644 index 0000000..d9afebb --- /dev/null +++ b/test/docs.js @@ -0,0 +1,18 @@ +'use strict'; + +/* jshint maxstatements: 30 */ + +var chai = require('chai'); +var should = chai.should(); +var expect = chai.expect; + +var bitcore = require('..'); + +describe('Address', function() { + + it('should throw an error because of bad network param', function() { + (function(){ + return new Address(PKHLivenet[0], 'main', 'pubkeyhash'); + }).should.throw('Second argument must be "livenet" or "testnet".'); + }); +}); From 3ebd615d4c169c85b2275ff0fc421df9279da88c Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Thu, 12 Feb 2015 11:17:14 -0300 Subject: [PATCH 2/2] check that there is no inconsistency between docs and bitcore version --- test/docs.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/docs.js b/test/docs.js index d9afebb..5ef532f 100644 --- a/test/docs.js +++ b/test/docs.js @@ -1,18 +1,17 @@ 'use strict'; -/* jshint maxstatements: 30 */ - var chai = require('chai'); var should = chai.should(); -var expect = chai.expect; var bitcore = require('..'); +var fs = require('fs'); -describe('Address', function() { +describe('Documentation', function() { - it('should throw an error because of bad network param', function() { - (function(){ - return new Address(PKHLivenet[0], 'main', 'pubkeyhash'); - }).should.throw('Second argument must be "livenet" or "testnet".'); + it('major and minor versions should match', function() { + var versionRE = /v[0-9]+\.[0-9]+/; + var docIndex = fs.readFileSync('./docs/index.md', 'ascii'); + var docVersion = docIndex.match(versionRE)[0]; + bitcore.version.indexOf(docVersion).should.equal(0); }); });