brandonweiss/rack-minitest — pull request #2 by elskwid (2014-01-08 09:41:06+00:00)
Title: Unit and spec support

Hi again Brandon,

I've pulled the pieces of rack-minitest out into modules to enable more flexible ways of using them.

* `Rack::Minitest::Assertions` is in assertions.rb and contains only the assertions now
* `Rack::Minitest::Expectations` is in expectations.rb. It requires the assertions, as they build on them.
* `Rack::Minitest::JSON` is in json.rb, the home for the json functionality.

These can be combined to create a nice little extension on Minitest. I updated the README to show that you can put them together the way you want or `include rack-minitest/test` and get the autowired version.

Here's rack-minitest/test.rb:

```ruby
require "rack/test"
require "rack-minitest/expectations"
require "rack-minitest/json"

class Minitest::Test
include Rack::Test::Methods
include Rack::Minitest::Expectations
include Rack::Minitest::JSON
end
```

It cleanly brings in all the pieces for the user of the gem. It has the added bonus of looking much like what Minitest does internally.

For testing, I made sure the tests keep the modules isolated, rather than mixing them all in the helper, so we can be sure the results are tested the way we want.

I realize this is quite a bit for a single pull request but I didn't see a clear way to divide this up. What do you think?

_(If you merge this it's probably a good idea to bump the version to indicate the breaking changes... I'm happy to help with that too if you like.)_