moved test code to /spec, corrected requires