[rspec-devel] [Proposed Refactoring] - Example -> ExampleDefinition && ExampleSpace -> Example

Dan North dan at tastapod.com
Tue Aug 21 18:36:06 EDT 2007


Hi Brian.

Brian Takita wrote:
> On 8/21/07, David Chelimsky <dchelimsky at gmail.com> wrote:
>   
>> On 8/21/07, Brian Takita <brian.takita at gmail.com> wrote:
>>     
>>> I propose renaming Example to ExampleDefinition and ExampleSpace to
>>> Example because the current ExampleSpace is the object that the
>>> example is run with.
>>>
>>> It seems a little too meta to be understandable, in my opinion.
>>>       
>> I agree about it feeling meta. And I like the idea of changing
>> ExampleSpace to Example. I'm not sure about ExampleDefinition though.
>> Other ideas that come to mind are:
>>
>> ExampleWrapper
>> ExampleProxy
>> ExampleDriver
>> ExampleConfig
>> ExampleContainer
>>     
The story runner calls it a World, because it's where everything takes 
place (it's a term I reused from jbehave). In the example runner I would 
expect to see something like ExampleInstance. Or maybe World again. I 
like calling the example block Example. That speaks to me.
>> Not really in love with any of these, but you get the idea.
>>
>>     
>>> ExampleDefinition is a fitting name for the current Example class
>>> because it would hold the description and matches? method.
>>>
>>> It also responsible for running the example and setting up and tearing
>>> down the mocks.
>>> Does this mean that this class has too much responsibility?
>>>       
>> I don't think so - it manages the lifecycle of an Example (perhaps
>> 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 :)
> How about ExampleLifeCycle?
>   
Not so much.

Cheers,
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20070821/eeda8b0d/attachment-0001.html 


More information about the rspec-devel mailing list