On 5/13/08, Pat Maddox <[EMAIL PROTECTED]> wrote:
> On 5/13/08, Jonathan Linowes <[EMAIL PROTECTED]> wrote:
> >
> > On May 13, 2008, at 6:39 PM, Helder Ribeiro wrote:
> >
> > > I'm not actually trying to test its behavior,
> >
> >
> > quick! Duck! INCOMING...!!!!!
> > _______________________________________________
> > rspec-users mailing list
> > rspec-users@rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> >
>
> I wonder why OP doesn't create two records, call #most_recent, and
> verify that the record returned is the one with the larger timestamp.
>
> If the code is "not yours" (and I think you ought to clarify what you
> mean by that), then you should be testing it at a higher level instead
> of directly.
>
> Pat
>

The other answer to your question is that #method_defined looks at the
instance methods. To do what you want, you should do

Foo.singleton_methods.should include("most_recent")

Pat
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to