[rspec-devel] [ rspec-Feature Requests-10460 ] Make it easier to create default BehaviourRunner

noreply at rubyforge.org noreply at rubyforge.org
Wed May 2 19:49:22 EDT 2007


Feature Requests item #10460, was opened at 2007-04-30 00:26
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10460&group_id=797

Category: None
Group: None
>Status: Closed
Priority: 3
Submitted By: Brian Takita (btakita)
Assigned to: Nobody (None)
Summary: Make it easier to create default BehaviourRunner

Initial Comment:
Right now, it is difficult to create a default BehaviourRunner in code. The easiest way to do so is to call create_behaviour_runner and pass in simulated command line args.

It would be nice if one would instantiate a BehaviourRunner in a "default" state and work from there.

So far I created a Spec::Runner::Options class to replace the OpenStruct implementation.

----------------------------------------------------------------------

>Comment By: Brian Takita (btakita)
Date: 2007-05-02 16:49

Message:
I implemented David's suggested refactoring.

I also created Options#create_behaviour_runner. I'm marking
this story is finished because the BehaviourRunner creation
is now decoupled from the parser.

Of course further refactoring are in order, but that is an
ongoing process.


----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-04-30 04:33

Message:
I like the idea of localizing the default settings like this, though it makes me think that Options should contain most of the decision making as well, passing command line args to methods on Options. That should make things more clear since right now we have the parsing and decision making all intermingled.

----------------------------------------------------------------------

Comment By: Brian Takita (btakita)
Date: 2007-04-30 01:40

Message:
I already checked in the Options class.

----------------------------------------------------------------------

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-04-30 00:57

Message:
Did you mean to attach the code?

----------------------------------------------------------------------

Comment By: Brian Takita (btakita)
Date: 2007-04-30 00:27

Message:
I'm thinking that the Spec::Runner::Options object can be
instantiated with default values.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10460&group_id=797


More information about the rspec-devel mailing list