Implemented RSpec for testing and added some tests.