Try adding

require "test/unit/assertions"
include Test::Unit::Assertions

2009/5/14 [email protected] <[email protected]>:
>
> Hi, all
>   when I run the following code
>
> require 'test/unit'
> class TC_Pram < Test::Unit::TestCase
>   def initialize(name)
>     @name=name
>   end
>   def test_array
>      puts assert_equal(2,@name[2])
>   end
> end
> tc=TC_Pram.new("wang")
> tc.test_array
>
> there will be the error information as follows
>
> c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:125:in `add_assertion':
> undefined method `add_assertion' for nil:NilClass (NoMethodError)
>  from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:494:in
> `_wrap_assertion'
>  from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:46:in
> `assert_block'
>  from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:83:in
> `assert_equal'
>  from test_unit.rb:7:in `test_array'
>  from test_unit.rb:11
>
>
> I don't know how to resolve it  so ,I hope to get your help
> here ,Thanks
>
> >
>

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