-
-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrote a couple of tests. They hit actual goog api tho - so kinda slow.
- Loading branch information
samcday
committed
Feb 9, 2013
1 parent
edde04e
commit 56bde4a
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
var assert = require("assert"); | ||
var GoogleSpreadsheets = require("google-spreadsheets"); | ||
require("should"); | ||
|
||
describe("google-spreadsheets", function() { | ||
this.timeout(0); | ||
it("can load a spreadsheet", function(done) { | ||
GoogleSpreadsheets({ | ||
key: "0ApDvWFF4RPZBdEFucnJya1hxVG9wZzhJQWZUWkpfekE" | ||
}, function(err, spreadsheet) { | ||
if(err) return done(err); | ||
spreadsheet.title.should.equal("Example Spreadsheet"); | ||
spreadsheet.author.name.should.equal("sam.c.day"); | ||
spreadsheet.author.email.should.equal("sam.c.day@gmail.com"); | ||
done(); | ||
}); | ||
}); | ||
it("can load spreadsheet cells", function(done) { | ||
GoogleSpreadsheets({ | ||
key: "0ApDvWFF4RPZBdEFucnJya1hxVG9wZzhJQWZUWkpfekE" | ||
}, function(err, spreadsheet) { | ||
if(err) return done(err); | ||
spreadsheet.worksheets[0].cells({ | ||
range: "R1C1:R1C2" | ||
}, function(err, result) { | ||
result.cells[1][1].value.should.equal("Hello,"); | ||
result.cells[1][2].value.should.equal("World!"); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |