andrewplummer/Sugar — pull request #131 by spaghetticode (2012-04-13 19:32:32+00:00)
Title: integrate travis-ci

Hello,

I love sugar.js: I use it whenever I can on projects both mine or from work. So today I cloned the repo, and being mostly a ruby coder was very happy there is a good node test suite to make sure anything works. Unfortunately running the tests on my local machine I got 2 errors for date:

1) Failure:
Date#is | accuracy | accurate to a year
Expected: true but was: false
File: undefined, Line: undefined Col: undefined

2) Failure:
Date#is | accuracy | accurate to a year
Expected: true but was: false
File: undefined, Line: undefined Col: undefined

I love tests and I love travis-ci (http://travis-ci.org/), which has a nice hook service with github that I use on many of my projects.
So I thought it was a good thing to add integration with travis to the library to expose the issue. So here it is my "travis" branch, basically I just added some config stuff and changed a little bit the setup.js file so that when run on node it exits to bash with the number of encountered errors, so allowing travis-ci to work properly. Travis-ci allows also to add a nice badge with build status on the github page readme, which is such a nice indicator when green ;-)

BTW on travis I get a totally different error while the tests failing on my local machine seem to pass... this is the encountered failure:

1) Failure:
Date#format | custom formats | z
Expected: "+00" but was: "+0"
File: undefined, Line: undefined Col: undefined

I am sorry I don't know the library inners enough to know why there is this inconsistency with test results or how to fix them, that's something I have to leave to you for now ;-)
If you have any question or I didn't make myself clear please drop me a line and I'll be happy to clarify.

I hope you appreciate my contribution, I would love to see my name on the contributors list if there is any :)

Wish you a nice weekend and hope to give you back more code in the future.

Regards

Andrea Longhi