refactor for rspec 3

Update the rspec gem library and rspec tests from v2 to v3.