upgrade ruby version
Add RSpec and refactor code