--- In [email protected], rofiq <[EMAIL PROTECTED]> wrote:
>
> mungkin ini maksudnya ya?
> 
> class DodolControllerTest < Test::Unit::TestCase
>    Dir[File.dirname(__FILE__) + '/../fixtures/*.yml'].map do |f|
>      fixtures File.basename(f, '.yml').to_sym
>    end
> 
>    # test codes
> end
> 
> 
> On Thu, 06 Sep 2007 13:01:15 +0700, Aditya Agustyana  
> <[EMAIL PROTECTED]> wrote:
> 
> > misalnya aplikasi kita mempunyai 100 tabel, nah di suatu controller
> > aplikasi tsb melibatkan banyak tabel
> >
> > permasalahan terjadi ketika ingin membuat functional test
> >
> > class DodolControllerTest < Test::Unit::TestCase
> >   fixtures
> >
:accounts,:penjuals,:pembelis,:pencuris,:entah_gak_tau_lagi_fixtures_apa_yg_terlibat_di_dodol_controller
> >
> >
> > so kepaksa lah, semua fixtures mesti di load, caranya gmn ..
> >
> > yg elegan adalah ketik satu2 sampe jarimu bengkak he he
> >
> > tapi kalo aku ogah ngetik 100 tabel di functional test sambil
> > ngeliatin phpmyadmin dengan nelangsa
> >
> > solusinya adalah
> >
> > result=Array.new
> > i=0
> > Dir.foreach('test/fixtures') do |f|
> >   if f=~/.yml~/
> >   elsif f=~/.yml/
> >     result[i]=":"+f.gsub(".yml","")
> >     i+=1
> >   end
> > end
> >
> > puts result.join(",")
> >
> >
> > simpen di folder script dgn nama terserah_saja.rb
> >
> > buka console, masuk ke RAILS_ROOT
> >
> > $ruby script/terserah_saja.rb
> > lalu bakal muncul
> >
:accounts,:penjuals,:pembelis,:pencuris,:entah_gak_tau_lagi_fixtures_apa_yg_terlibat_di_dodol_controller,:etc,
> > :de_el_el
> >
> > copy hasilnya lalu paste di functional test ....
> >
> > btw, caraku sebetulnya masih dodolz, mestinya kita ndak perlu
> > bulak-balik ke console buat copas...., tapi masih lum nemuin cara
> > tanpa perlu bolak-balik ke console
> >
> > kawans, ada yg punya cara yg lebih efisien ?
> >
> > ******
> > foot note
> > anonim : ya elah, elu bikin script kayak gitu, semua rubyist newbie
> > juga bisa, ngapain pulak diposting di milis
> > daku : biarin, banyak2-in postingan, soale denger2 issunya, kalo
> > postingan nyampe 1000 bakal dapet gelas dari oom modz
> >
> > peace ah, *kaboooooooooooooooor
> >
> >
> >
> >
> >
> > ID-Ruby
> > Berdiskusi dan belajar bersama Bahasa Pemrograman Ruby, termasuk
segala  
> > varian Ruby (JRuby, Rubinius, IronRuby, XRuby), dan program yang
dibuat  
> > dengan Ruby (Ruby on Rails, JRuby on Rails)
> >
> >     http://news.gmane.org/gmane.comp.lang.ruby.region.indonesia
> >
> > Yahoo! Groups Links
> >
> >
> >
> 
> 
> 
> -- 
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

nah iya, maksud saya gini... bleh di copas kan bro... he he, tak coba
ah :D
>


Kirim email ke