coffee-beans/scarf-api — pull request #5 by alonecuzzo (2014-01-08 06:16:35+00:00)
Title: initial spec added

I added a basic structure here for the location service.

I know I was talking about "manager this and façade that" but it seemed simpler to just put all of the functionality into one class for now just to get things started.

To run these, just do #npm install jasmine-node -g# on the command line. It has to be globally installed I think. I did add it to the package.json, but it didn't work at first.

I did add one failing test to sort of get you started, but feel free to mix and match as you please. But basically how I see this working is in the main app, when I hit the endpoint '/location?lat,lon' or something like that, it'll create the LocationService, do what it needs to do to hit the wunderground api, format the returned json from wunderground and then spit it back.

Note, that In the error throwing tests, it'd probably be better to just return an error json, but you get my drift.

See if you can get all these tests to pass. Let me know if you have any questions once you hit the actual json fetching stuff and how to test that.