[rspec-devel] [ rspec-Feature Requests-5634 ] support custom expectations

noreply at rubyforge.org noreply at rubyforge.org
Thu Oct 26 12:19:01 EDT 2006


Feature Requests item #5634, was opened at 2006-09-05 09:27
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=5634&group_id=797

Category: None
Group: None
Status: Open
Priority: 3
Submitted By: David Chelimsky (dchelimsky)
Assigned to: Nobody (None)
Summary: support custom expectations

Initial Comment:
Add a simple hook/API/whatever to allow people to easily build their own custom expectations.

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

>Comment By: Aslak Hellesoy (aslak_hellesoy)
Date: 2006-10-26 12:19

Message:
Makes sense

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

Comment By: David Chelimsky (dchelimsky)
Date: 2006-10-26 12:00

Message:
To clarify that last comment - this would still require monkey patching, but it would officially document a class to monkey patch that we would commit to maintain (in name).

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

Comment By: David Chelimsky (dchelimsky)
Date: 2006-10-26 11:56

Message:
I prefer not to encourage monkey patching because it binds rspec's structure to specs outside our control. For example, I recently changed Spec::ShouldHelper and Spec::ShouldNegator to Spec::Expectations::Should and Spec::Expectations::Not respectively. This would break anyone's specs if they were monkey patching.

I'm more inclined to expose a class specifically intended as a hook:

Spec::CustomExpectations

and have rspec look to that class to see if its instances respond to the method in question.

That make sense?

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

Comment By: Aslak Hellesoy (aslak_hellesoy)
Date: 2006-09-08 13:48

Message:
What about Ruby's monkeypathing feature?

Just add methods to Spec::ShouldHelper and Spec::ShuoldNegator?

I think this is just a matter of documentation.

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

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


More information about the rspec-devel mailing list