Skip to content

Commit

Permalink
🐛 Fix Document.getBaseDir API (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Sep 6, 2017
1 parent 0100b87 commit 54bc65c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions spec/node/asciidoctor.spec.js
@@ -1,5 +1,6 @@
var path = require('path');
var fs = require('fs');
var process = require('process');
var shareSpec = require('../share/asciidoctor.spec.js');
var config = {
runtime: {
Expand Down Expand Up @@ -61,6 +62,13 @@ describe('Node.js', function () {
});
});

describe('Loading document', function () {
it('should get the base directory', function () {
var doc = asciidoctor.load('== Test');
expect(doc.getBaseDir()).toBe(process.cwd());
});
});

describe('Loading file', function () {
it('should be able to load a file', function () {
var doc = asciidoctor.loadFile(__dirname + '/test.adoc');
Expand Down
2 changes: 1 addition & 1 deletion src/asciidoctor-core-api.js
Expand Up @@ -929,7 +929,7 @@ Document.$$proto.getCallouts = function () {
* @memberof Document
*/
Document.$$proto.getBaseDir = function () {
return this.$base_dir;
return this.base_dir;
};

/**
Expand Down

0 comments on commit 54bc65c

Please sign in to comment.