Re: [Pharo-dev] the return of the strange methods

2013-07-11 Thread Stéphane Ducasse
I would really like to have Sunit 5 in Pharo. Stef On Jul 10, 2013, at 6:45 PM, Jan Vrany jan.vr...@fit.cvut.cz wrote: What you want is a TAssertable#should:raise: that: - takes a one arg block as second argument that is evaluated with the exception thrown - fails if no exception is raised

Re: [Pharo-dev] the return of the strange methods

2013-07-11 Thread Stéphane Ducasse
On Jul 11, 2013, at 8:32 AM, Marcus Denker marcus.den...@inria.fr wrote: On Jul 11, 2013, at 8:26 AM, Stéphane Ducasse stephane.duca...@inria.fr wrote: I would really like to have Sunit 5 in Pharo. Of course we added lots of things to Sunit, so this means rewriting tests. (e.g.

Re: [Pharo-dev] the return of the strange methods

2013-07-10 Thread Igor Stasenko
On 9 July 2013 22:45, Nicolas Cellier nicolas.cellier.aka.n...@gmail.com wrote: should not raise an exceptional event whose description does not include wow, who is crooked enough to use double negation ;) is it a convenience method for following: [ self dosomething ] on: Error do: [:ex |

Re: [Pharo-dev] the return of the strange methods

2013-07-10 Thread Jan Vrany
What you want is a TAssertable#should:raise: that: - takes a one arg block as second argument that is evaluated with the exception thrown - fails if no exception is raised Then please call it #should:raise:suchThat: That's what is in upcoming SUnit 5.0 [1] Also I would avoid using traits in

[Pharo-dev] the return of the strange methods

2013-07-09 Thread Camillo Bruni
Survey: who uses the following methods? and if yes why? - shouldnt: aBlock raise: anExceptionalEvent whoseDescriptionDoesNotInclude: subString description: aString - shouldnt: aBlock raise: anExceptionalEvent whoseDescriptionIncludes: subString description: aString I honestly cannot

Re: [Pharo-dev] the return of the strange methods

2013-07-09 Thread Frank Shearar
On 9 July 2013 16:24, Camillo Bruni camillobr...@gmail.com wrote: Survey: who uses the following methods? and if yes why? - shouldnt: aBlock raise: anExceptionalEvent whoseDescriptionDoesNotInclude: subString description: aString - shouldnt: aBlock raise: anExceptionalEvent

Re: [Pharo-dev] the return of the strange methods

2013-07-09 Thread Clément Bera
They may be useful. Imagine you are too lazy to create a subclass of Error, but not lazy enough to create a test and copy paste a String. Then you write in your method: self error: 'some strange error happened' And you can test it: self shouldnt: [ some strange code ] raise: Error

Re: [Pharo-dev] the return of the strange methods

2013-07-09 Thread Max Leske
On 09.07.2013, at 17:42, Clément Bera bera.clem...@gmail.com wrote: They may be useful. Imagine you are too lazy to create a subclass of Error, but not lazy enough to create a test and copy paste a String. Then you write in your method: self error: 'some strange error happened' And you

Re: [Pharo-dev] the return of the strange methods

2013-07-09 Thread Frank Shearar
On 9 July 2013 16:42, Clément Bera bera.clem...@gmail.com wrote: They may be useful. Imagine you are too lazy to create a subclass of Error, but not lazy enough to create a test and copy paste a String. Then you write in your method: self error: 'some strange error happened' And you can test

Re: [Pharo-dev] the return of the strange methods

2013-07-09 Thread Esteban Lorenzano
Even more important, IMHO: allowing those methods to exists is to validate an anti-pattern: if you have an specific error to throw, you should create a specific descendant of Error, not just throw Error with an explanation. So, +A LOT to remove them. Esteban On Jul 9, 2013, at 5:42 PM,

Re: [Pharo-dev] the return of the strange methods

2013-07-09 Thread Frank Shearar
On 9 July 2013 17:42, Esteban Lorenzano esteba...@gmail.com wrote: Even more important, IMHO: allowing those methods to exists is to validate an anti-pattern: if you have an specific error to throw, you should create a specific descendant of Error, not just throw Error with an explanation.

Re: [Pharo-dev] the return of the strange methods

2013-07-09 Thread Camillo Bruni
On 2013-07-09, at 17:30, Frank Shearar frank.shea...@gmail.com wrote: On 9 July 2013 16:24, Camillo Bruni camillobr...@gmail.com wrote: Survey: who uses the following methods? and if yes why? - shouldnt: aBlock raise: anExceptionalEvent whoseDescriptionDoesNotInclude: subString

Re: [Pharo-dev] the return of the strange methods

2013-07-09 Thread Camillo Bruni
On 2013-07-09, at 18:48, Frank Shearar frank.shea...@gmail.com wrote: On 9 July 2013 17:42, Esteban Lorenzano esteba...@gmail.com wrote: Even more important, IMHO: allowing those methods to exists is to validate an anti-pattern: if you have an specific error to throw, you should create a

Re: [Pharo-dev] the return of the strange methods

2013-07-09 Thread Camille Teruel
On 9 juil. 2013, at 18:42, Esteban Lorenzano wrote: Even more important, IMHO: allowing those methods to exists is to validate an anti-pattern: if you have an specific error to throw, you should create a specific descendant of Error, not just throw Error with an explanation. So, +A LOT

Re: [Pharo-dev] the return of the strange methods

2013-07-09 Thread Nicolas Cellier
should not raise an exceptional event whose description does not include wow, who is crooked enough to use double negation ;) Nicolas 2013/7/9 Stéphane Ducasse stephane.duca...@inria.fr So + 1 :) - shouldnt: aBlock raise: anExceptionalEvent whoseDescriptionDoesNotInclude: subString