On 21 Apr 2015, at 10:22, Christophe Demarey <Christophe.Demarey@inria.fr> wrote:


Le 20 avr. 2015 � 18:23, Sean P. DeNigris a �crit :

Sean P. DeNigris wrote
refactor so that all those places use one implementation somewhere.

In fact, searching the sources for "beginsWith: 'test'", the logic is
duplicated quite a bit. And someone even snuck your proposed change into
CompiledMethod>>#isTestMethod, so now we already have two conflicting
concepts of what a test selector is in Core.

In fact, I already did the changes in an image (but not published, I wait for feedback) and I also noticed the duplicated logic.
Monty also pointed me to take care of this problem: https://pharo.fogbugz.com/f/cases/12280/Nautilus-treats-should-messages-as-tests-and-tries-to-run-them-TestRunner-doesn-t.

What I did is really simple:
  • In TestCase Class,
    • add 
<Capture d��cran 2015-04-21 � 10.12.36.png>

hi, side note: 
take into account that the use of #or: as you are using it is not recommended. 
Better something like: 

firstTerm 
or: [ secondTerm 
or: [ thirdTerm 
or [ etc. ] ] ]

yes, is uglier, but faster :)

cheers, 
Esteban

    • update #testSelectors and #methodChanged: to use #isTestSelector:
    • update shouldInheritSelectors to fix a wrong behavior
  • In ClassTestCase, update selectorsTested to use  #isTestSelector:
  • Update Nautilus extension method CompiledMethod>>isTestMethod to use TestCase>>#isTestSelector:

I will add a slice for that but I'm not sure if it is a good idea to include tests beginning with deny.