[rspec-users] Question: Define custom matcher like raise_error, by Matchers.define
dchelimsky at gmail.com
Sun Nov 28 16:23:12 EST 2010
On Nov 25, 2010, at 7:16 PM, Kaoru Kobo wrote:
> Then I found this page:
> ”Upgrade to 1.3.0 - Matcher DSL"
> Upgrade.rdoc at master from dchelimsky's rspec - GitHub
> and, I found the tentative solution:
> (Is there the better way?)
Actually, match_unless_raises is probably the best solution for your issue.
> Spec::Matchers.define :be_done do
> - match do |block|
> + # Do not turn any exceptions to false.
> + match_unless_raises(Class.new(Exception)) do |block|
> Best Regards.
> Kaoru Kobo
More information about the rspec-users