Skip to content
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.

Commit

Permalink
Fix test fallout from botched test index
Browse files Browse the repository at this point in the history
  • Loading branch information
brson committed Apr 15, 2015
1 parent 91fdfdf commit 9bc652d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
@@ -1,3 +1,3 @@
[submodule "test/crates.io-index"]
path = test/crates.io-index
url = https://github.com/rust-lang/crates.io-index
url = git://github.com/rust-lang/crates.io-index
5 changes: 3 additions & 2 deletions crater-db.js
Expand Up @@ -15,13 +15,14 @@ var util = require('./crater-util');
*/
function connect(config) {
var credentials = config.dbCredentials;
var dbname = config.dbName;

var dbctx = new Promise(function(resolve, reject) {
var client = new pg.Client({
database: config.dbName,
user: credentials.username,
password: credentials.password,
database: dbname
host: credentials.host || null,
port: credentials.port || null
});

client.connect(function(err) {
Expand Down
10 changes: 5 additions & 5 deletions test.js
Expand Up @@ -116,8 +116,8 @@ suite("local crate-index tests", function() {
p.then(function(crateData) {
return crates.getMostRecentRevs(crateData);
}).then(function(recent) {
assert(recent["toml"].vers == "0.1.18");
assert(recent["obj-rs"].vers == "0.4.2");
assert(recent["toml"].vers == "0.1.20");
assert(recent["obj-rs"].vers == "0.4.7");
done();
}).catch(function(e) { done(e); });
});
Expand All @@ -136,9 +136,9 @@ suite("local crate-index tests", function() {
var p = crates.loadCrates(testConfig);
p.then(function(crateData) {
var pop = crates.getPopularityMap(crateData);
assert(pop.time == 72);
assert(pop.num == 17);
assert(pop.piston == 0);
assert(pop.time == 92);
assert(pop.num == 66);
assert(pop.piston == 1);
done();
}).catch(function(e) { done(e); });
});
Expand Down
1 change: 1 addition & 0 deletions test/crates.io-index
Submodule crates.io-index added at d24369

0 comments on commit 9bc652d

Please sign in to comment.