------art_103721_25388435.1179757551947
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Thanks Gregory.... Guess this will work now...

But just to check.. will it not work if it is not enclosed in a method?

Is there an alternative way?


On 5/21/07, Gregory Brown <gregory.t.brown / gmail.com> wrote:
>
> On 5/21/07, Disha Tamhane <disha.tamhane / gmail.com> wrote:
> > Hey Gregory,
> >
> > Thanks for your response.
> >
> > Following is the code snippet that i am trying to test :
> >
> >
> > basedir  RGV[0]
>
> Wrap the code below in a method like this:
>
> def do_something_with_basedir(dir)
> #...
> end
>
> and pass it the values you want to test in your unit tests.
>
> > if (ARGV[0])
> >     contains  ir.new(basedir).entries
> >     for file in contains
> >         if (file ! ." && file !.")
> >             tokens  ile.split("-");
> >             model  okens[0]
> >             tokens1  okens[2].split(".xm")
> >             dealer  okens1[0]
> >             puts model + "," + dealer + "," + basedir + "/" + file
> >             getallocprsr  etAllocationsParser.new
> >             getallocprsr.parsefile(basedir + "/" + file)
> >             sql  UPDATE Validations set getAlloc   +
> > getallocprsr.allocation.to_s
> >             sql  ql + " where DealerName like '" + dealer + "' and
> > Vehicleline like '" + model + "'"
> >             puts sql
> >             db.updateQuery(sql)
> >         end
> >     end
> > else
> >
> >     puts "Usage :"
> >     puts ""
> >     puts "$> ruby a.rb <basedir> "
> >     puts ""
> >     puts "basedir : This is the base directory where the getAllocations
> > responses"
> >     puts "          can be found"
> >     puts ""
> > end
> > db.close
>
> If you want to test this text output, have a look at the StringIO docs
>
>

------art_103721_25388435.1179757551947--