collectiveidea/json_spec — pull request #22 by col (2012-02-24 05:19:12+00:00)
Title: Add a description method to all the json_spec matchers

I started using json_spec today and discovered that it didn't work well in rspec when using the subject shorthand.

Example:
'''ruby
describe "GET index as JSON" do
before :each do
get :index, :format => :json
end
subject { response.body }
it { should have_json_size(2) }
end
'''

As the 'it' block doesn't include a description it relies on the matcher to have a description method so that rspec can provided some useful output.

I've added a simple description method to each of the json_spec matchers and provided spec for each.

This is the first time I've submitted a pull request so let me know if I need to provide some more info.