[rspec-devel] The Reporter -> Formatter interface

Bob Cotton bob.cotton at rallydev.com
Fri Dec 14 12:26:48 EST 2007

"David Chelimsky" <dchelimsky at gmail.com> writes:

Congratulations on the release. I've stoked about the new features!

> Actually, as things stand now, the Example is an instance of the
> ExampleGroup class, each of which is unique and has its own
> description. Why don't you see if you can exploit that for your needs.

Good to know. I can use that. example.class gives the ExampleGroup. Any
possibility of adding a #example_group method that does the same? Just
to make it less magic?

One more question, given an instance of either an example of example
group, I'm having a hard time determining which is which, esp. when
test/unit in the in the mix.

Here's what I would like to do:

case example_or_example_group
when Spec::Example::ExampleGroup
  # something
when Spec::Example::Example
  # something else

>> example.class

>> Spec::Example::ExampleGroupMethods === example_group
=> true

other ideas?

More information about the rspec-devel mailing list