AlexWheeler/twenty20_API — pull request #2 by tommyschaefer (2014-12-03 18:53:54+00:00)
Title: Clean up specs

Hello again :smile:

Here are a couple changes that clean up and make the tests a bit more maintainable. I moved the logic for testing API Objects (item or challenge) into a shared example which pulls the objects attributes and defines tests for all of them.

I also cleaned up the client specs a bit by moving the `VCR.use_cassette` into around filters so they don't have to be repeated every time. I also leveraged some of RSpec's cool matchers to change things like `expect(val.empty?).to_not eq(true)` into `expect(val).not_to be_empty`. Because the tests for `#get_featured_items` and `#get_challenges` was pretty much the same at this point, I moved them to being generated by iterating over `{ get_featured_items: Twenty20::Item, get_challenges: Twenty20::Challenge }` and inserting the method name and expected object type where appropriate!

Thanks!