var dbPOIS = require('../src/pois.js');
var poi = require('../src/poi.js');
var db = require('./data/mockPOIs');


describe('POIS behavior', function ()
{
	it('Should return all available POIS', function ()
	{
		expect(dbPOIS.get().length).toBe(0);
	});

	it('Should return an error code of Invalid distance', function ()
	{
		expect(function () {dbPOIS.searchPoiByDistance(null,0)}).toThrow();
	});

	it('Should return 1 POI in the given radio r', function ()
	{
		dbPOIS.setDB(db);

		expect(dbPOIS.searchPoiByDistance(poi('GE',-34.609518, -58.396253,1),500).length).toBe(1);
		expect(dbPOIS.searchPoiByDistance(poi('GE',-34.609518, -58.396253,1),500)).toBe(poi('Alsina', -34.611510, -58.393490, 1));
	});


	it('Should return 3 POIs in the given radio r', function ()
	{
		dbPOIS.setDB(db);

		expect(dbPOIS.searchPoiByDistance(poi('GE',-34.609518, -58.396253,1),5000).length).toBe(3);
	});

});
@@ -557,108 +557,19 @@
 500)
-.length).toBe(1);%0A%09%09expect(dbPOIS.searchPoiByDistance(poi('GE',-34.609518, -58.396253,1),500)).toBe(
+).toEqual(%5B
 poi(
@@ -604,16 +604,17 @@
 3490, 1)
+%5D
 );%0A%09%7D);%0A
@@ -780,23 +780,145 @@
 000)
-.length).toBe(3
+).toEqual(%5Bpoi('Alsina', -34.611510, -58.393490, 1),poi('Obelisco', -34.604092, -58.381431, 1),poi('Antares', -34.613823, -58.373513, 1)%5D
 );%0A%09

Test refactor