Skip to content

Commit

Permalink
Merge pull request #21 from hubot-js/development
Browse files Browse the repository at this point in the history
Change db file location
  • Loading branch information
robsonbittencourt committed Jan 23, 2018
2 parents 6aaf8c6 + 5c93654 commit 0c0977d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "gear-jenkins",
"version": "2.1.1",
"version": "3.0.0",
"description": "A Hubot Gear for handle Jenkins tasks",
"main": "/src/jenkins.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/db.js
Expand Up @@ -22,7 +22,8 @@ function startDb() {
}

function open() {
const dbFile = `${gearPath()}/gear-jenkins.sqlite`;
const dbPath = path.join(process.env.HOME, 'hubot.js', 'data');
const dbFile = `${dbPath}/gear-jenkins.db`;

return sqlite.open(dbFile);
}
Expand Down
8 changes: 4 additions & 4 deletions test/db.js
Expand Up @@ -24,9 +24,9 @@ describe('Data base creation', () => {

db.getDb();

const basePath = path.resolve(__dirname, '../');
const basePath = path.join(process.env.HOME, 'hubot.js', 'data');

expect(openSpy.calledWith(`${basePath}/gear-jenkins.sqlite`)).to.be.true;
expect(openSpy.calledWith(`${basePath}/gear-jenkins.db`)).to.be.true;

migrateSpy().then(() => {
expect(migrateSpy.calledWithMatch(
Expand All @@ -46,9 +46,9 @@ describe('Data base creation', () => {

db.getDb();

const basePath = path.resolve(__dirname, '../');
const basePath = path.join(process.env.HOME, 'hubot.js', 'data');

expect(openSpy.calledWith(`${basePath}/gear-jenkins.sqlite`)).to.be.true;
expect(openSpy.calledWith(`${basePath}/gear-jenkins.db`)).to.be.true;
expect(migrateSpy.calledWithMatch(
{ migrationsPath: `${basePath}/migrations` })).to.be.false;
});
Expand Down

0 comments on commit 0c0977d

Please sign in to comment.