[squeak-dev] Phexample on Squeak

Frank Shearar frank.shearar at gmail.com
Tue Mar 12 21:36:05 UTC 2013


On 12 March 2013 16:16, Frank Shearar <frank.shearar at gmail.com> wrote:
> On 9 March 2013 00:11, Stefan Marr <smalltalk at stefan-marr.de> wrote:
>> Hi Frank:
>>
>> On 09 Mar 2013, at 00:45, Frank Shearar wrote:
>>
>>> I have only one blip: ForExampleStack >> #shouldFailWhenPopEmpty fails
>>> because instead of 'this collection is empty' the example fails with
>>> 'this stack is empty'.
>>
>> For Pharo I fixed it: http://smalltalkhub.com/#!/~Phexample/Phexample/diff/Phexample-StefanMarr.67
>>
>>  shouldFailWhenPopEmpty
>>         | stack |
>>         stack := self given: #shouldBeEmpty.
>>
>> +       [ stack pop ] should signal: Error withMessageText: 'a Stack() is empty'.!
>> -       [ stack pop ] should signal: Error withMessageText: 'this collection is empty'.!
>>
>> If you have a good idea how to handle platform-specific little things like that, I would add it.
>
> I don't for the general case. In _this_ case maybe we can find our way
> out of the mess by enhancing Phexample:
>
> shouldFailWhenPopEmpty
>        | stack |
>        stack := self given: #shouldBeEmpty.
>        [ stack pop ] should signal: Error withMessageTextMatching: 'a
> * is empty'.
>
> where signal:withMessageTextMatching: takes a regex, or even just a
> matcher like String >> #match: uses.
>
> My apologies for not replying with such an extension written!

Actually, it's easier to fix than that: just relax the test a teeny
bit. I've uploaded a fix to
http://ss3.gemstone.com/ss/Scratchpad-fbs/Phexample-fbs.64.

Stefan, I'd love to hear if this fixes Phexample for Pharo 1.4.

Niko, how do you handle receiving fixes?

> frank


More information about the Squeak-dev mailing list