Re: [rspec-users] Question: Define custom matcher like raise_error, by Matchers.define

2010-11-28 Thread Kaoru Kobo
David Thanks! Actually, match_unless_raises is probably the best solution for your issue. 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 tentativ

Re: [rspec-users] Question: Define custom matcher like raise_error, by Matchers.define

2010-11-28 Thread David Chelimsky
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 > http://github.com/dchelimsky/rspec/blob/master/Upgrade.rdoc > > > and, I found the tentative solution: > (Is there the better

Re: [rspec-users] Question: Define custom matcher like raise_error, by Matchers.define

2010-11-25 Thread Kaoru Kobo
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?) =

Re: [rspec-users] Question: Define custom matcher like raise_error, by Matchers.define

2010-11-25 Thread Kaoru Kobo
Thanks, David. This should work: ... match do |block| (block.call; true) rescue false end I tried that, but the spec still fails... 1) 'The expectation failure in block called from the custom matcher should be reported.' FAILED expected no Exception with message matching /be_done failed/,

Re: [rspec-users] Question: Define custom matcher like raise_error, by Matchers.define

2010-11-25 Thread David Chelimsky
On Nov 24, 2010, at 11:09 PM, 白井 薫 wrote: > I have a question about the custom matcher using Matcher#define. > > My intention is given by the following code: > > > Spec::Matchers.define :be_done do > match do |block| >

[rspec-users] Question: Define custom matcher like raise_error, by Matchers.define

2010-11-24 Thread 白井 薫
I have a question about the custom matcher using Matcher#define. My intention is given by the following code: Spec::Matchers.define :be_done do match do |block| block.call true end failure_message_for_should