2017-06-04 15:32 GMT+02:00 Denis Kudriashov <[email protected]>:

>
> 2017-06-04 15:03 GMT+02:00 Cyril Ferlicot D. <[email protected]>:
>
>> If most people agree that we should inherit the tests by default I think
>> this is a change that should be done very early in the Pharo 7 dev. Thus
>> it would let time to people to adapt their project.
>>
>
> I agree :)
>

+1 for inheriting by default.
If ever we don't want to inherit, it's as simple as implementing
shouldInheritSelectors
    ^false

It's far more simple than implementing isAbstract at class side as we have
to do now.
99% of the time we want to inherit, and what we see in order to avoid
isAbstract dance is
shouldInheritSelectors
    ^true


One more word about Pharo version.
In original SUnit we control with these simple two methods:

buildSuiteFromSelectors
    ^self shouldInheritSelectors
        ifTrue: [self buildSuiteFromAllSelectors]
        ifFalse: [self buildSuiteFromLocalSelectors]

shouldInheritSelectors
    ^self superclass isAbstract
        or: [self testSelectors isEmpty]

In Pharo this has been refactored:
- buildSuiteFromAllSelectors is not sent, but duplicated in
buildSuiteFromSelectors
- buildSuiteFromLocalSelectors is not sent either,
- all happens in allTestSelectors, which has changed of semantic and does
not allways answer all tests selectors :(
But the logic seems to remain the same: if the superclass is abstract OR if
the set of selectors is empty, then the class will inherit...
If my opinion ever counts, what I see is refactoring for refactoring.
I don't see any new feature, just more unsent selectors, more garbage, and
unclear semantic.
I call this runaway refactoring.
There's enough thing to clean in Squeak to avoid "cleaning" what works well
no?

Reply via email to