DEV Community

Discussion on: TestUnit - Writing Test Code In Ruby (1/3)

Collapse
 
kamalpanhwar profile image
Kamaluddin Panhwar

You have error you are return 'world2' but you are testing world in your assert_test case.

def self.world
    'world2'
  end
Enter fullscreen mode Exit fullscreen mode

but in your test

  assert_equal 'world', Hello.world, "Hello.world should return a string called 'world'"
Enter fullscreen mode Exit fullscreen mode

You should change it to world2 or in first function world