Hey gang,

I've set up a hash of labeled URLs:
 $pages = {"clint_eastwood"
=>"/view?id=%239202a8c04000641f8000000000056de6",
       "wood"
=>"/view?id=%239202a8c04000641f80000000002bb2f4",
       "home"                            =>"/view/",
       "all_domains"                 =>"/view/allDomains",
       "discuss_boats"              =>"/discuss/view?id=%2Fboats%2Fboat",
       "filter_musical_artist" =>"/view/filter?id=/music/artist",
       "filter_location"           =>"/view/filter?id=/location/location",
       "top_user_druderman"      =>"/view/user?id=/user/druderman"}

and have code that iterates through them and logs page load times to a CSV:
   $pages.each_key do |page|
     $results_array = []
     $results_array << page
     10.times do
       url = $url_root + $pages[page]
       $ie.goto(url)
       $results_array << $ie.down_load_time.to_s
     end

which in turn creates a CSV like this:
filter_musical_artist,1.212,1.282,1.442,1.296,1.242,1.512,1.282,1.182,1.292,
1.232
top_user_druderman,1.763,1.432,1.582,1.623,1.462,1.412,1.422,1.612,1.582,
1.422
filter_location,0.971,0.982,1.242,1.152,1.532,1.162,1.202,1.151,1.221,1.151
all_domains,1.032,0.951,0.661,0.851,0.731,0.871,0.49,0.882,0.701,0.851
wood,1.382,1.321,1.462,1.382,1.332,1.342,1.232,1.292,3.416,1.232
clint_eastwood,2.574,2.864,2.804,3.055,2.994,2.864,2.714,2.975,2.744,2.884
discuss_boats,1.041,0.561,0.561,0.531,0.551,0.571,0.551,0.571,0.541,0.531
home,1.001,1.041,1.032,1.041,1.031,0.982,1.011,1.052,1.132,1.011

So here's the question: Why aren't the csv results in the order of the hash?
And what order /are/ they in? There seems to be some method to the madness
here, because they come out consistently in the /same/ order...but it isn't
the order they are listed in the hash, or alphabetical by key or
value...anyone know how this works?

Thanks,
Jeff

--
http://testingjeff.wordpress.com
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to