[rspec-devel] [Proposed Refactoring] - Example -> ExampleDefinition && ExampleSpace -> Example
Jay Levitt
lists-rspec at shopwatch.org
Wed Aug 22 07:57:28 EDT 2007
On 8/22/2007 7:26 AM, David Chelimsky wrote:
> On 8/22/07, Brian Takita <brian.takita at gmail.com> wrote:
>> On 8/21/07, David Chelimsky <dchelimsky at gmail.com> wrote:
>>> On 8/21/07, Brian Takita <brian.takita at gmail.com> wrote:
>>>> On 8/21/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:
>>>>> On 8/22/07, Jim Deville <james.deville at gmail.com> wrote:
>>>>>>>>> ExampleLifeCycleManager???) and these things are all related.
>>>>>>>>>
>>>>>>>> I'm suspicious of anything named Manager :)
>>>>>>>>
>>>>>>> Seconded. Or Helper or Service or Util while we're at it :)
>>>>>> Service rings with me, perhaps some combination of it could work.
>>>>>>
>>>>> I think Dan meant Manager,Helper,Service,Util are all suspicious
>>>>> names, and I agree.
>>>>>
>>>>> I like ExampleWorld and Example.
>>> Well - which is which - in the story runner, the world is where the
>>> stuff happens - which would equate to the current example_space. So
>>> Example would remain Example, and ExampleSpace would become
>>> ExampleWorld. Is that what you are thinking Brian?
>> I was actuallly thinking the opposite.
>>
>> Comparing this with Test::Unit, a Behaviour is equivalent to a TestCase class.
>> ExampleSpace + Example is equivalent to a TestCase instance.
>>
>> Example holds the run and error adding methods, while ExampleSpace is
>> unpolluted by the run and other methods (not that this is really an
>> issue with Test::Unit).
>>
>> Here the the responsibilities for each part:
>> * The life of the example call chain (run, before and after callbacks,
>> setup and teardown mocks, etc.)
>> * The actual execution of the code within the example block, along
>> with the other methods defined in the Describe block
>>
>> Developers who wish to extend rspec will probably be subclassing
>> Behaviour and the current ExampleSpace. I feel a little strange having
>> other developers subclassing a class named ExampleSpace. Maybe
>> ExampleWorld is better, but Example seems like the most inviting name
>> to extend.
>
> I agree that what is now ExampleSpace should be Example, but I don't
> think that ExampleWorld is the right name for what is now Example. The
> World that Dan brought up is more aligned with what is current
> ExampleSpace - the place where stuff happens.
>
> So I re-submit earlier suggestions for consideration:
>
> ExampleWrapper
> ExampleProxy
> ExampleDriver
> ExampleConfig
> ExampleContainer
> ExampleLifeCycle
>
> Other ideas welcome - but they have to mean "the thing that manages
> the life cycle of an example" and not "the place where stuff happens."
ExampleNursery? :)
Jay
More information about the rspec-devel
mailing list