Linked Questions

Popular Questions

Hello I have a trouble with Ruby unit testing, I'm new to it so some help would be lovely

class TestItem < Test::Unit::TestCase
 def setUp
 def testGetType

Here the value of instance variable @item takes nil when I declare it in setUp() and use it in test functions! So I get an error like no method 'getType' for nil-class

But when I directly use it like assert_equal('Food','Burger',120).getType,'Food'),it works fine.

Please point out to my mistakes, thanks in advance

Related Questions