Assert_throws Problem

Hi,

I want to say that whatever exception is thrown just pass the test.

class When_a_negative_number_is_passed_to_the_prime_service < TestCase

def test_should_throw_an_exception

primeService = PrimeService.new
primeService.IsPrime(-2)
assert_throws System::Exception

end

end

The exception thrown from the C# side is ArgumentException

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs