refactoring_custom/SmallSense__CustomSubContextTests.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' }"
756
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
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: 761
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:#CustomSubContextTests
756
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    25
	instanceVariableNames:'model context'
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    26
	classVariableNames:''
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    27
	poolDictionaries:''
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    28
	category:'Interface-Refactoring-Custom-Tests'
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    29
!
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
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
!CustomSubContextTests 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
756
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    55
!CustomSubContextTests methodsFor:'initialization & release'!
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    56
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    57
setUp
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    58
    super setUp.
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    59
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    60
    model := CustomNamespace new.
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    61
    context := CustomSubContext new
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    62
        model: model;
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    63
        yourself
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    64
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    65
    "Modified: / 19-11-2014 / 19:59:15 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    66
! !
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    67
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    68
!CustomSubContextTests methodsFor:'tests'!
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    69
761
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    70
test_selected_classes_as_rb_class
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    71
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    72
    |expectedClasses actualClasses modelClass|
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    73
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    74
    modelClass := model classNamed: self class name.
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    75
    expectedClasses := Array with: modelClass.
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    76
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    77
    context selectedClasses: (Array with: self class).
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    78
    actualClasses := context selectedClasses.
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    79
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    80
    self assert: expectedClasses = actualClasses
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    81
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    82
    "Created: / 25-11-2014 / 20:31:01 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    83
!
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    84
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    85
test_selected_classes_existing_rb_class
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    86
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    87
    |expectedClasses actualClasses modelClass|
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    88
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    89
    modelClass := model classNamed: self class name.
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    90
    expectedClasses := Array with: modelClass.
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    91
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    92
    context selectedClasses: (Array with: modelClass).
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    93
    actualClasses := context selectedClasses.
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    94
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    95
    self assert: expectedClasses = actualClasses
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    96
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    97
    "Created: / 25-11-2014 / 20:37:54 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    98
!
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
    99
756
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   100
test_selected_methods_as_rb_method
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   101
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   102
    |expectedMethods realMethod actualMethods modelClass modelMethod|
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   103
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   104
    modelClass := model classNamed: self class name.
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   105
    modelMethod := modelClass compiledMethodAt: #test_selected_methods_as_rb_method.
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   106
    expectedMethods := Array with: modelMethod.
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   107
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   108
    realMethod := self class compiledMethodAt: #test_selected_methods_as_rb_method.
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   109
    context selectedMethods: (Array with: realMethod).
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   110
    actualMethods := context selectedMethods.
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   111
761
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
   112
    "Cannot test collection equality, because each contains different RBMethod instance
756
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   113
    self assert: expectedMethods = actualMethods"
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   114
    self assert: (expectedMethods size) = (actualMethods size).
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   115
    self assert: (expectedMethods first selector) = (actualMethods first selector).
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   116
    self assert: (expectedMethods first isKindOf: RBMethod).    
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   117
    self deny: expectedMethods first isMethod
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   118
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   119
    "Modified: / 19-11-2014 / 20:29:40 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
761
afbac76f54d3 fixed problem with different model in a generator and in the context
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 756
diff changeset
   120
    "Modified (comment): / 25-11-2014 / 20:30:37 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
756
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   121
!
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   122
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   123
test_selected_methods_existing_rb_method
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   124
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   125
    |expectedMethods actualMethods modelClass modelMethod|
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   126
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   127
    modelClass := model classNamed: self class name.
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   128
    modelMethod := modelClass compiledMethodAt: #test_selected_methods_as_rb_method.
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   129
    expectedMethods := Array with: modelMethod.
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   130
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   131
    context selectedMethods: (Array with: modelMethod).
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   132
    actualMethods := context selectedMethods.
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   133
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   134
    self assert: expectedMethods = actualMethods
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   135
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   136
    "Created: / 19-11-2014 / 20:30:39 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   137
! !
1dcd0b55815e added convert to RBMethod when real methods are passed into CustomSubContext >> selectedMethods:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   138