Make it fail nicer

and add rspec tests

Ready for travis?