Skip to content

Commit

Permalink
Upgraded to latest version of nom dependencies and fixed a few minor …
Browse files Browse the repository at this point in the history
…JSHint warnings.

Version bumped up to 0.0.9
  • Loading branch information
Ben Smith committed Jan 28, 2014
1 parent f2c2e64 commit 44ffdcc
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 40 deletions.
4 changes: 2 additions & 2 deletions lib/commands/balance.js
Expand Up @@ -32,8 +32,8 @@
var total = CommodityParser.parse(data[0].toString());

var obj = {
total: total,
account: {
total: total,
account: {
fullname: data[1],
shortname: data[2],
depth: parseInt(data[3], 10)
Expand Down
6 changes: 3 additions & 3 deletions lib/commands/register.js
Expand Up @@ -16,9 +16,9 @@
'%(quoted(display_account))',
'%(quoted(amount))'
];
var subsequentFormat = [
'%(quoted(display_account))',
'%(quoted(amount))'
var subsequentFormat = [
'%(quoted(display_account))',
'%(quoted(amount))'
];

function Register(cli) {
Expand Down
14 changes: 7 additions & 7 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "ledger-cli",
"homepage": "https://github.com/slashdotdash/node-ledger",
"version": "0.0.8",
"version": "0.0.9",
"description": "API for the ledger command-line interface (ledger-cli.org).",
"repository": {
"type": "git",
Expand All @@ -25,15 +25,15 @@
"lib": "lib"
},
"devDependencies": {
"jasmine-node": "~1.4.0",
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.3.0",
"grunt-contrib-watch": "~0.3.1",
"jasmine-node": "~1.13.0",
"grunt": "~0.4.2",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-jasmine-node": "~0.1.1"
},
"dependencies": {
"lodash": "~1.0.1",
"csv": "~0.2.9"
"lodash": "~2.4.1",
"csv": "~0.3.6"
},
"readmeFilename": "README.md"
}
22 changes: 11 additions & 11 deletions spec/balance.spec.js
Expand Up @@ -15,7 +15,7 @@ describe('Balance', function() {
var ledger, balances;

beforeEach(function(done) {
ledger = new Ledger({file: 'spec/data/single-transaction.dat'}),
ledger = new Ledger({file: 'spec/data/single-transaction.dat'});
balances = [];

ledger.balance()
Expand All @@ -31,37 +31,37 @@ describe('Balance', function() {
});
});

it("should return balance for two accounts", function() {
it('should return balance for two accounts', function() {
expect(balances.length).toBe(2);
});

it("should parse first balance", function() {
expect(balances[0]).toBeBalance({
it('should parse first balance', function() {
expect(balances[0]).toBeBalance({
total: {
currency: '£',
amount: 1000,
formatted: '£1,000.00'
},
account: {
},
account: {
fullname: 'Assets:Checking',
shortname: 'Assets:Checking',
depth: 2
}
});
});

it("should parse second balance", function() {
it('should parse second balance', function() {
expect(balances[1]).toBeBalance({
total: {
currency: '£',
amount: -1000,
formatted: '£-1,000.00'
},
account: {
fullname: 'Income:Salary',
},
account: {
fullname: 'Income:Salary',
shortname: 'Income:Salary',
depth: 2
}
}
});
});
});
Expand Down
30 changes: 15 additions & 15 deletions spec/register.spec.js
Expand Up @@ -15,7 +15,7 @@ describe('Register', function() {
var ledger, entries;

beforeEach(function(done) {
ledger = new Ledger({file: 'spec/data/single-transaction.dat'}),
ledger = new Ledger({file: 'spec/data/single-transaction.dat'});
entries = [];

ledger.register()
Expand All @@ -31,19 +31,19 @@ describe('Register', function() {
});
});

it("should return entry for single transaction", function() {
it('should return entry for single transaction', function() {
expect(entries.length).toBe(1);
});

it("should parse transaction", function() {
it('should parse transaction', function() {
var transaction = entries[0];
expect(transaction.date).toEqual(new Date(2013, 2, 19));
expect(transaction.payee).toBe('My Employer');
});

it("should parse the first posting", function() {
it('should parse the first posting', function() {
var posting = entries[0].postings[0];
expect(posting).toBePosting({
expect(posting).toBePosting({
commodity: {
currency: '£',
amount: 1000,
Expand All @@ -53,7 +53,7 @@ describe('Register', function() {
});
});

it("should parse the second posting", function() {
it('should parse the second posting', function() {
var posting = entries[0].postings[1];
expect(posting).toBePosting({
commodity: {
Expand All @@ -63,14 +63,14 @@ describe('Register', function() {
},
account: 'Income:Salary'
});
});
});
});

describe('filtering by account', function() {
var ledger, entries;

beforeEach(function(done) {
ledger = new Ledger({file: 'spec/data/drewr.dat'}),
ledger = new Ledger({file: 'spec/data/drewr.dat'});
entries = [];

ledger.register({account: 'Income'})
Expand All @@ -86,31 +86,31 @@ describe('Register', function() {
});
});

it("should return entries for two matching transactions", function() {
it('should return entries for two matching transactions', function() {
expect(entries.length).toBe(2);
});

it("should parse first transaction", function() {
it('should parse first transaction', function() {
var transaction = entries[0];
expect(transaction.date).toEqual(new Date(2004, 0, 5));
expect(transaction.payee).toBe('Employer');
expect(transaction.postings.length).toBe(1);
});

it("should parse second transaction", function() {
it('should parse second transaction', function() {
var transaction = entries[1];
expect(transaction.date).toEqual(new Date(2004, 1, 1));
expect(transaction.payee).toBe('Sale');
expect(transaction.postings.length).toBe(1);
expect(transaction.postings.length).toBe(1);
});
});

// Handle transactions where the payee contains a double quote (")
// Handle transactions where the payee contains a double quote (')
describe('quoted transaction', function() {
var ledger, entries;

beforeEach(function(done) {
ledger = new Ledger({file: 'spec/data/quoted-transaction.dat'}),
ledger = new Ledger({file: 'spec/data/quoted-transaction.dat'});
entries = [];

ledger.register()
Expand All @@ -126,7 +126,7 @@ describe('Register', function() {
});
});

it("should return entry for single transaction", function() {
it('should return entry for single transaction', function() {
expect(entries.length).toBe(1);
});
});
Expand Down
4 changes: 2 additions & 2 deletions spec/version.spec.js
Expand Up @@ -10,11 +10,11 @@ describe('Ledger', function() {
spec = this;
});

it("should return installed ledger-cli version", function(done) {
it('should return installed ledger-cli version', function(done) {
ledger.version(function(err, version) {
if (err) { return spec.fail(err); }

expect(version).toBe('3.0.0-20120518');
expect(version.substr(0, 5)).toBe('3.0.0');
done();
});
});
Expand Down

0 comments on commit 44ffdcc

Please sign in to comment.