Read up on Modules and Mixins:
http://www.rubycentral.com/book/tut_modules.html
 
-sean


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vishal Chavan
Sent: Friday, November 04, 2005 9:10 AM
To: [email protected]
Subject: [Wtr-general] Calling function from another RB file.

Hi All,

I wanted to seek your help in calling a function from another .RB file. Suppose I have a file one.rb which has following function:

require 'watir'
class Act
   def Act.contains_html( input )
    puts input
  end
end

Now from driver.rb file I want to call this Act.contains_html( input ) function. I have following code:

require 'watir'
require "one.rb"
load "one.rb"
Act.contains_html("test")

This does not work please advice how do I  get this working...

Thanks,

Vishal


 

Join SQAtester.com Community ---> http://www.sqatester.com/testersarea/joinus.htm
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to