Skip to content

Instantly share code, notes, and snippets.

@eknuth
Created January 15, 2012 20:48
Show Gist options
  • Save eknuth/1617156 to your computer and use it in GitHub Desktop.
Save eknuth/1617156 to your computer and use it in GitHub Desktop.
integration test for trimet module
var trimet = require('../lib/trimet.js'),
should = require('should');
describe('trimet: get nearest routes from coordinate', function() {
describe('getRoutesByPoint', function() {
it('should return some points', function(done) {
var lat = 45.499541,
lon = -122.613639,
expectedRoutes = [{
route: 9,
description: 'Powell/Broadway',
distance: 0.00200889736828729
}, {
route: 14,
description: 'Hawthorne',
distance: 0.00229043846550735
}];
trimet.getRouteByPoint(lat, lon, function(err, data) {
should.not.exist(err);
should.exist(data);
data.should.eql(expectedRoutes);
done();
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment