Add rspec

start testing
minor refactoring
integration test
trucate fix and test