Natasha,

Try putting this include in your module

include Test::Unit::Assertions

Bret wrote around this topic some time ago

http://www.io.com/~wazmo/blog/archives/2006_05.html#000238

Aidy


On 28/11/2008, Natasha <[EMAIL PROTECTED]> wrote:
>
>  Hello All,
>
>  I am unable to call the assert method through a Module.
>  I am able to execute the same statement through test function.
>
>  I am going to paste the code of Test function and Module. The assert
>  statement executes successfully when called through the test function.
>  But fails when its part of a module function. I am invoking the module
>  function through the test case function. I tried reinstalling ruby and
>  watir. But its still failing. I tried various changes, but nothing
>  worked. I tried invoking the assert method from Module function using
>  'Test::Unit::Assertions.assert()'
>
>  I need help here. I have loads of assert statements in my module and
>  somehow want to get this working.
>
>
>  Test Function code:
>  
> -------------------------------------------------------------------------------
>  require 'watir'
>  require 'test/unit'
>
>  module NewTest
>
>  def asserttest
>
>  puts "\n Hello testing assert through module"
>
>   assert(1==1, "false")
>
>
>  puts 'assert succeeded'
>
>  end
>
>  end
>  
> -------------------------------------------------------------------------------
>
>  Module:
>  
> -------------------------------------------------------------------------------
>  require 'watir'
>  require 'test/unit'
>
>  require 'NewTest'
>
>  include NewTest
>
>  class Moduletest < Test::Unit::TestCase
>
>   def test_a_orderPlacement
>
>  puts "\nCalling assert from test function"
>  assert(1 ==1,"failed assertion")
>  puts "Assert call succeeded\n\n"
>
>  puts "Calling assert method from module method"
>  NewTest.asserttest()
>  puts "\n Called module method successfully\n\n"
>
>  end
>
>  end
>  
> -------------------------------------------------------------------------------
>
>  Thanks,
>
> Natasha
>  >
>

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to