Put in rspec for unit testing

Included a minimal unit test.