Problem running script using include module in a class

Hi All,

I am new to WATIR/ruby programming and this is my first program in ruby.
I am trying call methods included in a module from the class. I am doing
something wrong. while running the above attached script, I am getting
this error “>ruby isell_regression_script_moduletest.rb:174: undefined
method `test_login’ for TC_isell:Class (NoMethodError)>Exit code: 1”

             Could you please take a look at the script and guide me

in right direction. I appreciated your help in this regard

Thanks,
Sat

Sat nosur wrote in post #1024002:

             Could you please take a look at the script and guide me

in right direction. I appreciated your help in this regard

Test::Unit::TestCase needs an instance method called test_*. e.g. like
this:

class TC_isell < Test::Unit::TestCase

include UsefulMethods

def test_everything
test_login($ie)
test_CompanyDetail($ie)
test_Send_To_CRM($ie)
test_ProspectFolder_Triggers($ie)
test_useradmin($Sie)
end
end

If you don’t include these method calls inside another method, then they
are executed at the time the code is loaded. e.g.

class Foo
puts “Hello world”
end

This code prints out “Hello world”, as the code between class Foo and
end is executed at the time the class is defined.

But when def … end is executed, it defines a method. The code within
the method isn’t called until the method is called.

HTH,

Brian.

Hi Brain,

Thank you very much for your help. The script worked fine with your
solution

-Sat

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs