[rspec-users] Stubbing an instance method on a class

brian ford brixen at gmail.com
Thu Dec 21 18:06:23 EST 2006


David,

Thanks for the response. I'll be sure to check the RFE's first next
time. Forgot to do that. :(

Brian

On 12/21/06, David Chelimsky <dchelimsky at gmail.com> wrote:
> On 12/20/06, brian ford <brixen at gmail.com> wrote:
> > Hi all,
> >
> > I'm not sure if I've missed it, but I couldn't find any docs for
> > stubbing an instance method on a class. For example:
> >
> > class Foo; end
> >
> > Foo.stub!(:my_instance_method).and_return(nil)
>
> Hasn't been implemented yet, but there is an RFE:
>
> http://rubyforge.org/tracker/index.php?func=detail&aid=6791&group_id=797&atid=3152
>
> >
> > The reason (I think) I need this is because a certain class
> > (Test::Unit::TestCase) expects an argument (name of method) to new and
> > throws an exception if that instance method doesn't exist.
> >
> > Thanks,
> > Brian
> > _______________________________________________
> > rspec-users mailing list
> > rspec-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> >
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list