ruby-amqp/amqp-spec — pull request #5 by tomstrummer (2012-02-17 00:29:53+00:00)
Title: Compatibility with MiniTest::Spec

I'm guessing MiniTest::Spec doesn't pass any `example_group_instance` to `&block`. So I was getting an error like this:

3) Error:
test_0002_must_start_up_correctly(TestconsumerSpec):
ArgumentError: wrong number of arguments (0 for 1)
/Users/tnichols/.rvm/gems/ruby-1.9.2-p290/gems/evented-spec-0.10.0.pre/lib/evented-spec/amqp_spec.rb:20:in `block in it'

I was originally going to try to detect whether MiniTest was in use by doing `Object.const_defined? "MiniTest"` but this seems to work with both without doing any detection. Defaulting the `example_group_instance=self` parameter seems to work. And I'm guessing it's backwards compatible with RSpec. I tested under Ruby 1.9.2.