collectiveidea/json_spec — pull request #64 by myitcv (2013-12-03 10:41:25+00:00)
Title: Add be_json_subset matcher

With due reference to #61 and #62

This is a first cut of a new `be_json_subset` matcher.

Tests and potential update to README included.

The one thing I found whilst doing this (leaning heavily on the tests for `be_json_eql`) is that the notion of `at_path` reads one way be is interpreted another. Here is a working test against the new matcher:

```ruby
%({"json":{"laser":"lemon"}}).should be_json_subset(%({"laser":"lemon"})).at_path("json")
```

The following pseudo code however reads better given what was intended:

```ruby
%({"json":{"laser":"lemon"}}).at_path("json").should be_json_subset(%({"laser":"lemon"}))
```

So whilst I have implemented `at_path` (again leaning heavily on the `be_json_eql` implementation) it doesn't read well to my mind. But this is really a separate issue.

Thoughts welcomed on the PR.