check that there is no inconsistency between docs and bitcore version

This commit is contained in:
Manuel Araoz 2015-02-12 11:17:14 -03:00
parent b23d0bc7c9
commit 3ebd615d4c
1 changed files with 7 additions and 8 deletions

View File

@ -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);
});
});