diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-03-24 23:14:17 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-03-24 23:14:17 +0100 |
commit | c9af209a9335ea1219c3149eb12c2daa271c9403 (patch) | |
tree | 72df3edf7a67db465ce2dacbbf204974253b818a /test/conrefs.js | |
parent | 63ee94ff89d10e56d82079183c494f8129b92eae (diff) | |
parent | 48ab44a776b665b1d3627192cf82e9220ec74678 (diff) | |
download | gitbook-c9af209a9335ea1219c3149eb12c2daa271c9403.zip gitbook-c9af209a9335ea1219c3149eb12c2daa271c9403.tar.gz gitbook-c9af209a9335ea1219c3149eb12c2daa271c9403.tar.bz2 |
Merge pull request #667 from GitbookIO/better-testing
Better Unit Tests
Diffstat (limited to 'test/conrefs.js')
-rw-r--r-- | test/conrefs.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/conrefs.js b/test/conrefs.js new file mode 100644 index 0000000..8d6a181 --- /dev/null +++ b/test/conrefs.js @@ -0,0 +1,43 @@ +var fs = require('fs'); +var path = require('path'); + +describe('ConRefs', function () { + var book, readme; + + before(function() { + return books.generate("conrefs", "website") + .then(function(_book) { + book = _book; + + readme = fs.readFileSync( + path.join(book.options.output, "index.html"), + { encoding: "utf-8" } + ); + }); + }); + + it('should handle local references', function() { + readme.should.be.html({ + ".page-inner p#t1": { + count: 1, + text: "Hello World", + trim: true + } + }); + }); + + it('should handle git references', function() { + readme.should.be.html({ + ".page-inner p#t2": { + count: 1, + text: "Hello from git", + trim: true + }, + ".page-inner p#t3": { + count: 1, + text: "First Hello. Hello from git", + trim: true + } + }); + }); +}); |