{"issue":{"state":"closed","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/607564f1a15f1899c71b4a9fdfc33ac2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"607564f1a15f1899c71b4a9fdfc33ac2","url":"https://api.github.com/users/semaperepelitsa","login":"semaperepelitsa","id":347921},"milestone":null,"labels":[],"updated_at":"2011-11-06T10:13:10Z","assignee":null,"comments":4,"closed_at":"2011-11-06T00:58:15Z","url":"https://api.github.com/repos/seattlerb/minitest/issues/66","body":"I was trying to switch from Mocha to MiniTest Mock. But I haven't find a way to make a mock object to expect some method that raise an exception. For example, here is a simplified version of the test that I have. \r\n\r\n```ruby\r\nbank = mock\r\nbank.expects(:exchange_with).raises(Money::Bank::UnknownRate)\r\nassert_equal \"N/A\", formatted_money(123.to_money(:usd), :aaa, bank)\r\n```\r\n`formatted_money` is returning a string with nice representation of money in the specified currency. But when the currency does not exist bank won't know how to convert the money and will raise an exception. In that case `formatted_money` should just return \"N/A\".\r\n\r\nI have read the minitest/mock.rb and I don't have any ideas how to integrate this in a simple way, unfortunately :-(","html_url":"https://github.com/seattlerb/minitest/issues/66","number":66,"title":"Mock: expect method that raise an exception","id":2154061,"created_at":"2011-11-05T23:03:27Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/607564f1a15f1899c71b4a9fdfc33ac2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"607564f1a15f1899c71b4a9fdfc33ac2","url":"https://api.github.com/users/semaperepelitsa","login":"semaperepelitsa","id":347921},"updated_at":"2011-11-06T10:13:09Z","url":"https://api.github.com/repos/seattlerb/minitest/issues/comments/2644672","body":"This is where Mock records method calls, right?","id":2644672,"created_at":"2011-11-06T10:13:09Z"}}