Remove your include statements. Even though we used to tell people to do 
this, this is never correct Ruby and doesn't do what you think it does.

Bret

Jason 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
>
>
> >
>   


-- 
Bret Pettichord
CTO, WatirCraft LLC, www.watircraft.com
Lead Developer, Watir, www.watir.com
Blog, www.io.com/~wazmo/blog
Twitter, www.twitter.com/bpettichord

Watir Training: Portland/Beaverton April 16-17
www.watircraft.com/training


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to