[rspec-devel] [ rspec-Feature Requests-6791 ] stub return values for all instances of a class

noreply at rubyforge.org noreply at rubyforge.org
Mon Nov 20 11:50:37 EST 2006


Feature Requests item #6791, was opened at 2006-11-20 16:50
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6791&group_id=797

Category: mock module
Group: None
Status: Open
Priority: 3
Submitted By: David Chelimsky (dchelimsky)
Assigned to: Nobody (None)
Summary: stub return values for all instances of a class

Initial Comment:
I'd like to be able to do this:

SomeClass.stub_instance_method!(:method_name).and_return(specified_value)

(syntax just a suggestion)

This should set up a world in which all instances of SomeClass return specified_value for any calls to :method_name.

This differs from SomeClass.stub! in that it applies to instance methods rather than class methods.

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

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


More information about the rspec-devel mailing list