我想这样做:
some_method.should_raise <any kind of exception, I don't care>
我该怎么做?
some_method.should_raise exception
... 没用.
我想这样做:
some_method.should_raise <any kind of exception, I don't care>
我该怎么做?
some_method.should_raise exception
... 没用.
expect { some_method }.to raise_error
RSpec 1 Syntax:
lambda { some_method }.should raise_error
更多信息,请参见the documentation(rspec1语法)和RSpec 2 documentation.