Skip to content

Commit

Permalink
Fix broken Slime tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrichau committed Jan 2, 2024
1 parent 6003bc7 commit 4e6a36e
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
tests-block
testCallSuperImplementation
| object painter |
object := self
defineClass: #WASlimeMockObject
superclass: #WAObject.
self compile: 'postCopy self postCopy' in: object.
| class painter |
class := self defineSubClassOf: #WAObject.
self compile: 'postCopy self postCopy' in: class.
painter := self
defineClass: #WASlimeMockComponent
superclass: #WAPainter.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
tests-block
testChangesStateWhileRendering
| class |
class := self
defineClass: #WASlimeMockComponent
superclass: #WAComponent.
class addInstanceVariable: 'foo'.
class := self defineSubClassOf: #WAComponent.
class addInstVarNamed: 'foo'.
self compile: 'renderContentOn: html html div: [ foo := nil ]' in: class.
self
runRule: WAChangesStateWhileRenderingRule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
tests-parsetree
testExtractCallbackCodeToMethod
| class |
class := self
defineClass: #WASlimeMockComponent
superclass: #WAComponent.
class
class := self defineSubClassOf: #WAComponent.
self
compile: 'renderInvalidOn: html
html anchor
callback: [ self foo. self bar ];
with: 1'
classified: #(rendering).
class
in: class.
self
compile: 'renderValidOn: html
html anchor
callback: [ self foo ];
with: 1'
classified: #(rendering).
in: class.
self
runRule: WAExtractCallbackCodeToMethodRule
selectors: #(renderInvalidOn:)
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
tests-parsetree
testSendsRenderContentOn
| class |
class := self
defineClass: #WASlimeMockComponent
superclass: #WAComponent.
class
class := self defineSubClassOf: #WAComponent.
self
compile: 'invalid self renderContentOn: nil'
classified: #(rendering).
in: class.
self
runRule: WASendsRenderContentOnRule
selectors: #(invalid)
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
tests-parsetree
testSequencedAsynchronousCalls
| class |
class := self
defineClass: #WASlimeMockComponent
superclass: #WAComponent.
class
class := self defineSubClassOf: #WAComponent.
self
compile: 'renderContent1On: html
html div
onClick: (html jQuery ajax callback: [ ]) , (html jQuery ajax serializeForm);
with: ''Click me'''
classified: #(rendering).
class
in: class.
self
compile: 'renderContent2On: html
html div
onClick: (html jQuery ajax serializeForm; callback: [ ]) , (html jQuery effect bounce);
with: ''Click me'''
classified: #(rendering).
in: class.
self
runRule: WASequencedAsynchronousCallsRule
selectors: #(renderContent1On: renderContent2On:)
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
tests-parsetree
testUnnecessaryBlockPassedToBrush
| class |
class := self
defineClass: #WASlimeMockComponent
superclass: #WAComponent.
class
class := self defineSubClassOf: #WAComponent.
self
compile: 'renderContent01On: html html div: [ ]'
classified: #(rendering).
class
in: class.
self
compile: 'renderContent02On: html html div: [ html text: 2 ]'
classified: #(rendering).
class
in: class.
self
compile: 'renderContent03On: html html div: [ html render: 3 ]'
classified: #(rendering).
class
in: class.
self
compile: 'renderContent04On: html html div class: #foo; with: [ ]'
classified: #(rendering).
class
in: class.
self
compile: 'renderContent05On: html html div class: #foo; with: [ html text: 5 ]'
classified: #(rendering).
class
in: class.
self
compile: 'renderContent06On: html html div class: #foo; with: [ html render: 6 ]'
classified: #(rendering).
in: class.
self
runRule: WAUnnecessaryBlockPassedToBrushRule
selectors: #(renderContent01On: renderContent02On: renderContent03On: renderContent04On: renderContent05On: renderContent06On:)
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
tests-parsetree
testUnnecessaryWithSentToBrush
| class |
class := self
defineClass: #WASlimeMockComponent
superclass: #WAComponent.
class
class := self defineSubClassOf: #WAComponent.
self
compile: 'renderContentOn: html html div with: 123'
classified: #(rendering).
in: class.
self
runRule: WAUnnecessaryWithSentToBrushRule
selectors: #(renderContentOn:)
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
tests-parsetree
testUsesWrongRenderer
| class |
class := self
defineClass: #WASlimeMockComponent
superclass: #WAComponent.
class
class := self defineSubClassOf: #WAComponent.
self
compile: 'renderContentOn: html
html updater callback: [ :r | html div ]'
classified: #(rendering).
in: class.
self
runRule: WAUsesWrongRendererRule
selectors: #(renderContentOn:)
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
tests-parsetree
testWithHasToBeLastMessageInCascade
| class |
class := self
defineClass: #WASlimeMockComponent
superclass: #WAComponent.
class
class := self defineSubClassOf: #WAComponent.
self
compile: 'renderContent01On: html
html div
with: ''foo'';
class: ''bar'''
classified: #(rendering).
class
in: class.
self
compile: 'renderContent02On: html
html div
id: ''zork'';
with: ''foo'';
class: ''bar'''
classified: #(rendering).
in: class.
self
runRule: WAWithHasToBeLastMessageInCascadeRule
selectors: #(renderContent01On: renderContent02On:)

0 comments on commit 4e6a36e

Please sign in to comment.