[RPS] a couple of things

Edward Cho zerokarmaleft at gmail.com
Wed Jul 27 13:00:51 EDT 2005


On 7/27/05, Sean Carley <seanacarley at gmail.com> wrote:
> On 7/26/05, pat eyler <pat.eyler at gmail.com> wrote:
> > On 7/26/05, Sean Carley <seanacarley at gmail.com> wrote:
> 
> [snip]
> 
> > > assert_array_of and assert_n_array_of were very useful in reducing the
> > > amount of repeated code.  I am not completely happy with the names,
> > > especially of assert_n_array_of.  assert_array_of(Entry, entries)
> > > seems to read well, but assert_n_array_of(Person, people, 10) does not
> > > communicate I want to see an array of 10 Person objects as well as I
> > > would like.  Also, while writing test code I would frequently start
> > > with assert_array_of and after I knew how long it would be I would
> > > switch to assert_n_array_of.  It may seem trivial but adding _n (or
> > > n_) in the middle of the word was annoying.  If someone can suggest
> > > better names, I would appreciate it.
> >
> > What about 'assert_number_of'?  Something like:
> >
> >  assert_number_of(10,Person,people)
> >
> 
> I think I like assert_number_of(Person, people, 10).  I would read it
> as assert the number of Person in people is 10.

Agreed.

Ed



More information about the Therps-discuss mailing list