Regarding bulletpoints 2 and 3: If you reference the module name before the method, you'll run the appropriate method (e.g Module.method vs. method)
Take a look at http://www.ruby-doc.org/docs/ProgrammingRuby/. Specifically: Classes, Objects and Variables; and Modules (both links listed in the left hand nav). On Mar 26, 3:54 pm, Jason <freezingki...@gmail.com> wrote: > I've got a bunch of scripts that I "load" and "include". Seems like > the sensible thing to do: > > load 'global.rb' > include Global > load 'login.rb' > include Login > etc, etc. > > In the above login.rb, there's the following: > > def login(username, password) > < yada yada > > end > > However I'm also loading a *whole* lot of other scripts from a > completely different watir library (for another application works > alongside this application under test). > > Within this is another piece of code with another def with the same > name as above: > > def login(username, password) > < yada yada different stuff > > end > > * Firstly, is there something completely wrong with doing this? Both > Apps have their own Login screen which differ slightly, I think I'd > like to keep the login script for each different. > > * When I run "login({username}, {password})" it tends to pickup the > incorrect Module and try to execute the *other* version of login(). > Any way I can force which one it should use? > > * Anyone got any good links for understanding Classes / Modules / Def > a little better. I think I'm failing to understand this completely. > > - Jason --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---