Eliot Miranda uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-eem.193.mcz ==================== Summary ==================== Name: Tests-eem.193 Author: eem Time: 27 March 2013, 12:39:06.474 pm UUID: 6843d697-b8a7-49fd-88fa-05a98c9ce96f Ancestors: Tests-fbs.192 Tests minus ClassTestCase now moved to SUnit (SUnit-eem.93) =============== Diff against Tests-fbs.192 =============== Item was removed: - TestCase subclass: #ClassTestCase - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'Tests-Utilities'! - - !ClassTestCase commentStamp: 'brp 7/26/2003 16:57' prior: 0! - This class is intended for unit tests of individual classes and their metaclasses. - - It provides methods to determine the coverage of the unit tests. - - Subclasses are expected to re-implement #classesToBeTested and #selectorsToBeIgnored. - - They should also implement to confirm that all methods have been tested. - - #testCoverage - - super testCoverage. - - ! Item was removed: - ----- Method: ClassTestCase class>>isAbstract (in category 'Testing') ----- - isAbstract - "Override to true if a TestCase subclass is Abstract and should not have - TestCase instances built from it" - - ^self name = #ClassTestCase - ! Item was removed: - ----- Method: ClassTestCase class>>mustTestCoverage (in category 'Testing') ----- - mustTestCoverage - - ^ false! Item was removed: - ----- Method: ClassTestCase>>categoriesForClass: (in category 'private') ----- - categoriesForClass: aClass - - ^ aClass organization allMethodSelectors collect: - [:each | aClass organization categoryOfElement: each]. - ! Item was removed: - ----- Method: ClassTestCase>>classToBeTested (in category 'coverage') ----- - classToBeTested - - self subclassResponsibility! Item was removed: - ----- Method: ClassTestCase>>selectorsNotTested (in category 'coverage') ----- - selectorsNotTested - - ^ self selectorsToBeTested difference: self selectorsTested. - ! Item was removed: - ----- Method: ClassTestCase>>selectorsTested (in category 'Coverage') ----- - selectorsTested - | literals | - literals := Set new. - self class - selectorsAndMethodsDo: [ :s :m | (s beginsWith: 'test') - ifTrue: [ literals addAll: (m messages)] ]. - ^ literals asSortedArray! Item was removed: - ----- Method: ClassTestCase>>selectorsToBeIgnored (in category 'coverage') ----- - selectorsToBeIgnored - ^ #(#DoIt #DoItIn:)! Item was removed: - ----- Method: ClassTestCase>>selectorsToBeTested (in category 'coverage') ----- - selectorsToBeTested - - ^ ( { self classToBeTested. self classToBeTested class } gather: [:c | c selectors]) - difference: self selectorsToBeIgnored! Item was removed: - ----- Method: ClassTestCase>>targetClass (in category 'private') ----- - targetClass - |className| - - className := self class name asText copyFrom: 0 to: self class name size - 4. - ^ Smalltalk at: (className asString asSymbol). - ! Item was removed: - ----- Method: ClassTestCase>>testClassComment (in category 'tests') ----- - testClassComment - self shouldnt: [self targetClass organization hasNoComment].! Item was removed: - ----- Method: ClassTestCase>>testCoverage (in category 'tests') ----- - testCoverage - - | untested | - self class mustTestCoverage ifTrue: - [ untested := self selectorsNotTested. - self assert: untested isEmpty - description: untested size asString, ' selectors are not covered' ]! Item was removed: - ----- Method: ClassTestCase>>testNew (in category 'tests') ----- - testNew - self shouldnt: [self targetClass new] raise: Error.! Item was removed: - ----- Method: ClassTestCase>>testUnCategorizedMethods (in category 'tests') ----- - testUnCategorizedMethods - | categories slips | - categories := self categoriesForClass: self targetClass. - slips := categories select: [:each | each = #'as yet unclassified']. - self should: [slips isEmpty]. ! |
Free forum by Nabble | Edit this page |