[rspec-users] Question: Define custom matcher like raise_error, by Matchers.define
Kaoru Kobo
pub at kaorukobo.net
Thu Nov 25 20:16:33 EST 2010
Then I found this page:
”Upgrade to 1.3.0 - Matcher DSL"
Upgrade.rdoc at master from dchelimsky's rspec - GitHub
http://github.com/dchelimsky/rspec/blob/master/Upgrade.rdoc
and, I found the tentative solution:
(Is there the better way?)
========================================================================
Spec::Matchers.define :be_done do
- match do |block|
+ # Do not turn any exceptions to false.
+ match_unless_raises(Class.new(Exception)) do |block|
block.call
true
end
========================================================================
Best Regards.
--
Kaoru Kobo
More information about the rspec-users
mailing list