Issue 3391 in pharo: BlockClosure>>assertWithDescription: sends #logFailure:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 3391 in pharo: BlockClosure>>assertWithDescription: sends #logFailure:

pharo
Status: Accepted
Owner: [hidden email]

New issue 3391 by [hidden email]: BlockClosure>>assertWithDescription:  
sends #logFailure:
http://code.google.com/p/pharo/issues/detail?id=3391

In a PharoCore image (Pharo1.1.1 #11414 or Pharo1.2a #12271) the only  
sender of #assertWithDescription: is RxMatcher>>split: ... which wouldn't  
be that bad, except that BlockClosure>>assertWithDescription: sends  
#logFailure: which is only implemented in TestCase ....

Soooo, it appears that assertWithDescription: should only be sent from  
instances of TestCase (and send removed from RxMatcher>>split:) or the send  
of #logFailure: removed from BlockClosure>>assertWithDescription: ...

Found this on in GemStone testing while trying to figure out a test case  
that would trigger a failure of #assertWithDescription:, which BTW, I  
couldn't do .... so the #assertWithDescription: is probably unnecessary (or  
we need a test case to trigger the assertion)...


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3391 in pharo: BlockClosure>>assertWithDescription: sends #logFailure:

pharo
Updates:
        Labels: Milestone-1.2

Comment #1 on issue 3391 by stephane.ducasse:  
BlockClosure>>assertWithDescription: sends #logFailure:
http://code.google.com/p/pharo/issues/detail?id=3391

argh we should fix that!


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3391 in pharo: BlockClosure>>assertWithDescription: sends #logFailure:

pharo

Comment #2 on issue 3391 by stephane.ducasse:  
BlockClosure>>assertWithDescription: sends #logFailure:
http://code.google.com/p/pharo/issues/detail?id=3391

I have no idea what would be logFailure: on Closure and I would like to  
avoid it.



Reply | Threaded
Open this post in threaded view
|

Re: Issue 3391 in pharo: BlockClosure>>assertWithDescription: sends #logFailure:

pharo

Comment #3 on issue 3391 by stephane.ducasse:  
BlockClosure>>assertWithDescription: sends #logFailure:
http://code.google.com/p/pharo/issues/detail?id=3391

The first thing I would do is

assertWithDescription: aStringOrABlock
        self value ifFalse: [
                |value|
                value := aStringOrABlock value.
                AssertionFailure signal: value]

because logFailure: in anycase write to Transcript


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3391 in pharo: BlockClosure>>assertWithDescription: sends #logFailure:

pharo
Updates:
        Status: Closed

Comment #4 on issue 3391 by marcus.denker:  
BlockClosure>>assertWithDescription: sends #logFailure:
http://code.google.com/p/pharo/issues/detail?id=3391

I removed the call to #logFailure

12273