refactoring_custom/SmallSense__CustomClassQueryTests.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 13 Nov 2017 22:26:12 -0300
changeset 1060 af3a048f9618
parent 833 297eb38e4eee
child 1072 a44c741ee5ef
permissions -rw-r--r--
Fixed xompletion of instance variables in inspector
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
829
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     1
"
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     2
A custom code generation and refactoring support for Smalltalk/X
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     3
Copyright (C) 2013-2015 Jakub Nesveda
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     4
Copyright (C) 2013-now  Jan Vrany
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     5
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     6
This library is free software; you can redistribute it and/or
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     7
modify it under the terms of the GNU Lesser General Public
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     8
License as published by the Free Software Foundation; either
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     9
version 2.1 of the License.
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    10
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    11
This library is distributed in the hope that it will be useful,
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    12
but WITHOUT ANY WARRANTY; without even the implied warranty of
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    14
Lesser General Public License for more details.
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    15
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    16
You should have received a copy of the GNU Lesser General Public
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    17
License along with this library; if not, write to the Free Software
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    19
"
833
297eb38e4eee Package jn:refactoring_custom renamed to stx:goodies/smallsense/refactoring_custom
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 830
diff changeset
    20
"{ Package: 'stx:goodies/smallsense/refactoring_custom' }"
571
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    21
830
1a88f5e65fe2 Classes moved to namespace SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 829
diff changeset
    22
"{ NameSpace: SmallSense }"
803
95cdac772759 Fixed failing tests caused by new STX release
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 734
diff changeset
    23
830
1a88f5e65fe2 Classes moved to namespace SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 829
diff changeset
    24
Smalltalk::TestCase subclass:#CustomClassQueryTests
688
6bd18ba5e56c completed - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 686
diff changeset
    25
	instanceVariableNames:'classQuery model mockSuperClass mockClass'
571
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    26
	classVariableNames:''
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    27
	poolDictionaries:''
734
f8b10fc1ab0e update TestCase categories with respect to their tested subjects ( classes )
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 705
diff changeset
    28
	category:'Interface-Refactoring-Custom-Helpers-Tests'
571
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    29
!
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    30
829
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    31
!CustomClassQueryTests class methodsFor:'documentation'!
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    32
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    33
copyright
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    34
"
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    35
A custom code generation and refactoring support for Smalltalk/X
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    36
Copyright (C) 2013-2015 Jakub Nesveda
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    37
Copyright (C) 2013-now  Jan Vrany
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    38
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    39
This library is free software; you can redistribute it and/or
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    40
modify it under the terms of the GNU Lesser General Public
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    41
License as published by the Free Software Foundation; either
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    42
version 2.1 of the License.
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    43
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    44
This library is distributed in the hope that it will be useful,
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    45
but WITHOUT ANY WARRANTY; without even the implied warranty of
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    46
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    47
Lesser General Public License for more details.
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    48
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    49
You should have received a copy of the GNU Lesser General Public
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    50
License along with this library; if not, write to the Free Software
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    51
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    52
"
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    53
! !
59bfd92fcef0 Test fixes (all test pass now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    54
571
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    55
!CustomClassQueryTests methodsFor:'initialization & release'!
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    56
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    57
setUp
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    58
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    59
    classQuery := CustomClassQuery new.
688
6bd18ba5e56c completed - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 686
diff changeset
    60
    model := CustomNamespace new.
6bd18ba5e56c completed - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 686
diff changeset
    61
    mockSuperClass := model createClassImmediate: 'MockSuperClassForTestCase' superClassName: 'Object'.
6bd18ba5e56c completed - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 686
diff changeset
    62
    mockClass := model createClassImmediate: 'MockClassForTestCase' superClassName: (mockSuperClass new className).
571
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    63
688
6bd18ba5e56c completed - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 686
diff changeset
    64
    "Modified: / 09-10-2014 / 09:33:36 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
571
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    65
!
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    66
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    67
tearDown
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    68
705
1eb0878dc85c rename undoChanges to redoChanges, because it actually does undo, in CustomLocalChangeManager, CustomNamespace, CustomRefactoryBuilder
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 688
diff changeset
    69
    model undoChanges
571
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    70
705
1eb0878dc85c rename undoChanges to redoChanges, because it actually does undo, in CustomLocalChangeManager, CustomNamespace, CustomRefactoryBuilder
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 688
diff changeset
    71
    "Modified: / 19-10-2014 / 14:56:20 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
571
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    72
! !
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    73
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    74
!CustomClassQueryTests methodsFor:'tests'!
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    75
686
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    76
test_method_from_superclass_not_found_01
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    77
    | method |                                                                              
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    78
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    79
    method := classQuery methodForSuperclassSelector: 'someNonExistingMethod:withParam:' class: Object.
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    80
    self assert: method isNil.
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    81
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    82
    "Created: / 07-10-2014 / 19:54:22 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    83
!
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    84
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    85
test_method_from_superclass_not_found_02
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    86
    | method |                                                                              
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    87
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    88
    method := classQuery methodForSuperclassSelector: 'someNonExistingMethod:withParam:' class: self class.
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    89
    self assert: method isNil.
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    90
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    91
    "Created: / 07-10-2014 / 19:54:33 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    92
!
12e570ea6c6e work in progress - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 571
diff changeset
    93
571
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    94
test_method_from_superclass_retrieved
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    95
    | method |
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    96
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    97
    self assert: (classQuery methodForSuperclassSelector: 'initialize' class: Object) isNil.
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    98
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    99
    "/ Instance method
688
6bd18ba5e56c completed - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 686
diff changeset
   100
    model createMethodImmediate: mockSuperClass protocol: 'instance-protocol' source: 'instanceMethod: aParam
571
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   101
    self shouldImplement'.
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   102
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   103
    method := classQuery methodForSuperclassSelector: #instanceMethod: class: mockClass.
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   104
    self assert: 'instance-protocol' = method category.
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   105
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   106
    self assert: 'instanceMethod:aParam' = method methodDefinitionTemplate.
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   107
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   108
    "/ Class method
688
6bd18ba5e56c completed - rewriting code generators to replace CustomSourceCodeBuilder, but RBClass, RBMetaclass, RBNamespace and CodeGenerator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 686
diff changeset
   109
    model createMethodImmediate: mockSuperClass class protocol: 'class-protocol' source: 'classMethod: aParam
571
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   110
    self shouldImplement'.
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   111
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   112
    method := classQuery methodForSuperclassSelector: 'classMethod:' class: mockClass class.
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   113
    self assert: 'class-protocol' = method category.
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   114
    self assert: 'classMethod:aParam' = method methodDefinitionTemplate.
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   115
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   116
    "Created: / 14-04-2014 / 18:12:57 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   117
    "Modified: / 15-06-2014 / 16:17:09 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   118
! !
25a316ce0c9c extracted method methodForSuperclassSelector from class CustomSubclassResponsibilityCodeGenerator to CustomClassQuery
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   119