2013/1/22 Stéphane Ducasse <stephane.ducasse@inria.fr>
it would be nice to introduce the same syntax than Sunit
exp assert: exp2
[ exp ] shouldraise:
StateSpecs (package separated from Mocketry) implements it. And such "should" syntax extendable by pragmas. Your example looks like: [exp] should raise: Error It is implemented with main spec class RaisingExceptionSpec RaisingExceptionSpec >>basicMatches: aBlockContext [aBlockContext value. ^false] on: requiredException do: [:ex | ex class = SpecFailed ifTrue: [ex outer]. ^true] And single method in special DSL class: Raise>>exception: aClass <syntax: #(raise:)> ^RaisingExceptionSpec requiredException: aClass
Stef
On Jan 21, 2013, at 4:41 AM, Benjamin wrote:
Hi guys,
I am attending a python lecture and discovered DocTest[1], and I was wondering if such a tool exists for Pharo ? :)
Ben