Require statements use single quotes.

 

In your driver.rb file try:

 

require 'watir'

require 'one.rb'

load "one.rb"

Act.contains_html("test")

 

Note:

Commenting out load “one.rb” as in

 

require 'watir'

require 'one.rb'

#load "one.rb"

Act.contains_html("test")

 

also works, so not sure if you need this load statement or not. I’m guessing not.

 

Tom


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vishal Chavan
Sent: Friday, November 04, 2005 10: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