Skip to content

Commit

Permalink
Added tests for invalid instance variable setting and getting
Browse files Browse the repository at this point in the history
  • Loading branch information
mtabacman committed Feb 20, 2025
1 parent 52ab7c1 commit 022fada
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions source/Buoy-Metaprogramming-Tests/LanguagePlatformTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ LanguagePlatformTest >> testForkNamedAt [
self assert: wasEvaluated
]

{ #category : 'tests' }
LanguagePlatformTest >> testGetInvalidInstanceVariable [

self
should: [ LanguagePlatform current instanceVariableNamed: 'variableForFailing' on: self ]
raise: Error
]

{ #category : 'tests' }
LanguagePlatformTest >> testGlobalNamedIfAbsent [

Expand Down Expand Up @@ -204,3 +212,11 @@ LanguagePlatformTest >> testRemoveGlobalNamedIfAbsent [
ifAbsent: [ wasFound := false ].
self deny: wasFound
]

{ #category : 'tests' }
LanguagePlatformTest >> testSetInvalidInstanceVariable [

self
should: [ LanguagePlatform current atInstanceVariableNamed: 'variableForFailing' on: self put: 8 ]
raise: Error
]

0 comments on commit 022fada

Please sign in to comment.