move to rspec and fix tests