Please check here for example on how to do this:

https://github.com/rubyspec/rubyspec/blob/master/core/thread/raise_spec.rb#L44-L53