Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correcting tests in FASTCopyVisitorCodeGeneratorTest (+ removed tearDown) #80

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/FAST-Core-Tools-Tests/FASTCopyVisitorCodeGeneratorTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,15 @@ FASTCopyVisitorCodeGeneratorTest >> setUp [
visitorMethods add: method -> category ]
]

{ #category : 'running' }
FASTCopyVisitorCodeGeneratorTest >> tearDown [
super tearDown.

self class package extensionMethods do: #removeFromSystem
]

{ #category : 'tests' }
FASTCopyVisitorCodeGeneratorTest >> testGenerateCopyMethod [

generator rootClass: FmxTraitsTestGenerateAccessorBEntity visitorClass: visitorClass.

self assertGeneratedMethod: [ :methodCode |
methodCode beginsWith: 'copy: ' ]
[ self assertGeneratedMethod: [ :methodCode |
methodCode beginsWith: 'copy: ' ]
]
ensure: [ self class package extensionMethods do: #removeFromSystem ]
]

{ #category : 'tests' }
Expand Down Expand Up @@ -98,10 +93,13 @@ FASTCopyVisitorCodeGeneratorTest >> testShouldNotCopyMultivaluedDerivedProperty
property := FmxTraitsTestGenerateAccessorBClassB asMooseDescription
allProperties detect: [ :prop | prop name = 'relationToA' ].

"focing it to be multivalued"
"forcing it to be multivalued"
property isMultivalued: true.
self assert: property isMultivalued.
self deny: (generator shouldCopyProperty: property)
[
self assert: property isMultivalued.
self deny: (generator shouldCopyProperty: property)
]
ensure: [ property isMultivalued: false ]
]

{ #category : 'tests' }
Expand All @@ -114,6 +112,8 @@ FASTCopyVisitorCodeGeneratorTest >> testShouldNotCopyPropertyParent [

"forcing it to be to parent"
property isContainer: true.
self assert: property isContainer.
self deny: (generator shouldCopyProperty: property)
[ self assert: property isContainer.
self deny: (generator shouldCopyProperty: property)
]
ensure: [ property isContainer: false ]
]
Loading