added raised exceptions and more rspec tests