Below is my code
begin
Test.testcode
rescue
end
i want to test my exception handling logic and for that i am doing
Test.stubs(:testcode).raises(Exception,"jkkh")
but my test is not passing. i am getting below error in test cases
<?xml version="1.0" encoding="UTF-8"?>
<testsuite time="3.211" assertions="0" tests="1" errors="1" failures="0" skipped="0" name="OpnavPreCalculationsControllerTest">
<testcase time="3.211" assertions="0" name="test_should" classname="OpnavPreCalculationsControllerTest">
<error message="Exception: jkkh..." type="test_should"> Failure: test_should(OpnavPreCalculationsControllerTest) [C:/jruby-1.7.16/lib/ruby/gems/shared/gems/mocha-1.1.0/lib/mocha/exception_raiser.rb:11]: Exception: jkkh </error>
</testcase>
</testsuite>