[Pkg] The Trunk: Tests-jr.362.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Feb 2 12:08:25 UTC 2017


Marcel Taeumel uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-jr.362.mcz

==================== Summary ====================

Name: Tests-jr.362
Author: jr
Time: 22 January 2017, 2:18:34.010832 am
UUID: 67cd6b66-44de-774a-bfea-625e0c50d00a
Ancestors: Tests-jr.361

add another test for Environments-jr.69

This time about not altering other environments when unbinding a symbol.

=============== Diff against Tests-jr.361 ===============

Item was added:
+ ----- Method: EnvironmentTest>>testUnbindDoesNotAlterImportedBindings (in category 'observation tests') -----
+ testUnbindDoesNotAlterImportedBindings
+ 	"When attempting to unbind a symbol, do not alter bindings outside of the envrionments'
+ 	own declarations."
+ 
+ 	| foreign foreignBinding one two |
+ 	foreign := Environment withName: #Foreign.
+ 	foreign exportSelf.
+ 	foreign bind: #Griffle to: value.
+ 	foreignBinding := foreign associationAt: #Griffle.
+ 	env at: #Griffle put: Object new.
+ 	env importSelf.
+ 	env import: foreign.
+ 	one := env bindingOf: #Griffle.
+ 	self assert: one == foreignBinding description: 'imported binding'.
+ 	
+ 	env unbind: #Griffle.
+ 	two := env bindingOf: #Griffle.
+ 	self assert: value equals: foreignBinding value description: 'imported value unaffacted'.
+ 	self assert: two == foreignBinding description: 'imported binding still in place'.!



More information about the Packages mailing list